Help: The wiki page is available there: http://wiki.glx-dock.org

Included cairo-dock-compiz-integration.h with the settings for DBus
      Unity: only enable the menu if this is the new version of Compiz and the name of the plugin seems to be 'unityshell'
      Moved unity and gnome-panel entries in the submenu.
Compiz-Integration: with Compiz 0.9, there is an error if we want to change the active plugins with DBus (we have this error in Compiz: [compiz (core) - Warn: Can't set Value with type 12 to option active_plugins with type 11] ; same error with dbus-send...) => workaround: used a script with gconf and the flat file
Data/scripts: Help_scripts: updated compiz_plugin for Compiz 0.9 and added compiz_new_replace_list_plugins (for Compiz 0.9 - workaround)
This commit is contained in:
Matthieu Baerts
2011-09-17 16:05:38 +02:00
parent af6573022f
commit 5ee327ef4c
7 changed files with 144 additions and 43 deletions

View File

@@ -1,4 +1,21 @@
#!/bin/sh
#!/bin/bash
# Script for the Help applet of Cairo-Dock
#
# Copyright : (C) see the 'copyright' file.
# E-mail : see the 'copyright' file.
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# http://www.gnu.org/licenses/licenses.html#GPL
ARG=$1
ARG2=$2
@@ -64,10 +81,44 @@ debian_unstable() {
}
compiz_plugin() {
COMPIZ_PLUGINS=`gconftool-2 --get /apps/compiz/general/allscreens/options/active_plugins`
if [ `echo $COMPIZ_PLUGINS |grep -c $ARG2` -eq 0 ]; then
NEW_PG_LIST="`echo $COMPIZ_PLUGINS |cut -d] -f1`,$ARG2]"
gconftool-2 --type list --list-type string --set /apps/compiz/general/allscreens/options/active_plugins "$NEW_PG_LIST"
if test -d "$HOME/.config/compiz"; then # compiz < 0.9
# flat file
if test -f "$HOME/.config/compiz/compizconfig/Default.ini"; then
sed -i "/as_active_plugins/ s/.*/&;$ARG2/g" $HOME/.config/compiz/compizconfig/Default.ini
fi
# gconf
plugins=`gconftool-2 -g /apps/compiz/general/allscreens/options/active_plugins`
gconftool-2 -s /apps/compiz/general/allscreens/options/active_plugins --type=list --list-type=string "${plugins:0:${#plugins}-1},$ARG2]" # plug-ins in double are filtered by Compiz.
fi
if test -d "$HOME/.config/compiz-1"; then # compiz >= 0.9 => we can have compiz and compiz-1
# plug-ins in double are NO LONGER filtered by Compiz in this version... (and if plugins in double, compiz crashes :) )
# flat file
if test -f "$HOME/.config/compiz-1/compizconfig/Default.ini"; then
pluginsFlat=`grep "s0_active_plugins" $HOME/.config/compiz-1/compizconfig/Default.ini`
if test `echo $pluginsFlat | grep -c $ARG2` -eq 0; then
pluginsFlat="$pluginsFlat""$ARG2;"
sed -i "/s0_active_plugins/ s/.*/&$ARG2;/g" $HOME/.config/compiz-1/compizconfig/Default.ini
fi
fi
# gconf
plugins=`gconftool-2 -g /apps/compiz-1/general/screen0/options/active_plugins`
if test `echo $plugins | grep -c $ARG2` -eq 0; then
plugins=${plugins:0:${#plugins}-1},$ARG2]
gconftool-2 -s /apps/compiz-1/general/screen0/options/active_plugins --type=list --list-type=string "$plugins"
fi
fi
}
compiz_new_replace_list_plugins() {
if test -d "$HOME/.config/compiz-1"; then # only for compiz 0.9
# flat file
if test -f "$HOME/.config/compiz-1/compizconfig/Default.ini"; then
pluginsList="s0_active_plugins = "`echo $ARG2 |sed -e 's/,/;/g'`";" # , => ;
sed -i "/s0_active_plugins/ s/.*/$ARG2/g" $HOME/.config/compiz-1/compizconfig/Default.ini
fi
# gconf
gconftool-2 -s /apps/compiz-1/general/screen0/options/active_plugins --type=list --list-type=string "[$ARG2]"
fi
}
@@ -90,5 +141,8 @@ case $ARG in
"compiz_plugin")
compiz_plugin
;;
"compiz_new_replace_list_plugins")
compiz_new_replace_list_plugins
;;
esac
exit