答案1
现在 gconf 中存储启用的 compiz 插件的键名为:
/apps/compizconfig-1/profiles/Default/general/screen0/options/active_plugins
现在你必须使用:
gconftool-2 --get /apps/compizconfig-1/profiles/Default/general/screen0/options/active_plugins
分别:
gconftool-2 --set --type=list --list-type=string /apps/compizconfig-1/profiles/Default/general/screen0/options/active_plugins "[list,goes,in,here]"
答案2
从 Ubuntu 13.01 开始,Compiz 使用 dconf 而不是 gconf 作为后端。
列出活动的 compiz 插件
在终端中运行dconf dump /org/compiz/profiles/unity/ | grep active-plugins
。这将给你类似
active-plugins=['core', 'composite', 'opengl', 'wall', 'resize', 'vpswitch', 'compiztoolbox', 'move', 'snap', 'grid', 'imgpng', 'commands', 'unitymtgrabhandles', 'mousepoll', 'place', 'copytex', 'regex', 'session', 'animation', 'fade', 'expo', 'workarounds', 'ezoom', 'scale', 'unityshell']
按用户更改
查看答案https://askubuntu.com/a/320677/10475
全系统变革
答案3
/apps/compiz-1/general/screen0/options/active_plugins
用。。。来代替/apps/compizconfig-1/profiles/Default/general/screen0/options /active_plugins
因此gconftool-2 --get /apps/compizconfig-1/profiles/Default/general/screen0/options /active_plugins
将打印活动插件。
#!/bin/bash
pluginName='obs'
unset activePlugins_old
if ( gconftool-2 -g /apps/compiz-1/general/screen0/options/active_plugins 2> /dev/null | grep -q '.' )
then
activePlugins_old=`gconftool-2 -g /apps/compiz-1/general/screen0/options/active_plugins`
path='/apps/compiz-1/general/screen0/options/active_plugins'
elif ( gconftool-2 -g /apps/compizconfig-1/profiles/Default/general/screen0/options/active_plugins 2> /dev/null | grep -q '.' )
then
activePlugins_old=`gconftool-2 -g /apps/compizconfig-1/profiles/Default/general/screen0/options/active_plugins`
path='/apps/compizconfig-1/profiles/Default/general/screen0/options/active_plugins'
elif ( gconftool-2 -g /apps/compiz/general/allscreens/options/active_plugins )
then
activePlugins_old=`gconftool-2 -g /apps/compiz/general/allscreens/options/active_plugins`
path='/apps/compiz/general/allscreens/options/active_plugins'
else
echo 'ERROR getting active_plugins'
exit 1
fi
echo "Using
gconftool-2 -g $path"
#echo "Active plugins are : $activePlugins_old"
if ! ( echo "$activePlugins_old" | grep -q "$pluginName" ) # Not enabled
then
echo -n 'Activating plugin.. '
if ( echo $activePlugins_old | grep -q "." ) # Enabled
then
if ( echo $activePlugins_old | grep -q "\[\]" ) # Empty
then
gconftool-2 --type=list --list-type=string -s "$path" "[$pluginName]"
else # some active plugins
gconftool-2 --type=list --list-type=string -s "$path" "$( echo -n "$activePlugins_old" | sed "s/]$/,$pluginName]/" )"
fi
else
sleep 7
gconftool-2 --type=list --list-type=string -s "$path" "[$pluginName]"
echo 'Activated'
fi
else
echo 'Plug-in already enabled'
fi