From d48246ed65549aef3d0ede869ef5a3cb1de8efe7 Mon Sep 17 00:00:00 2001 From: Holger Paradies Date: Sun, 21 Apr 2013 14:25:33 +0200 Subject: add-fusion-icon-to-script-and-add-other-checks --- kanotix-lxde-extra/kanotix-start-compiz | 58 +++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/kanotix-lxde-extra/kanotix-start-compiz b/kanotix-lxde-extra/kanotix-start-compiz index 306f56e..a3e8fb1 100644 --- a/kanotix-lxde-extra/kanotix-start-compiz +++ b/kanotix-lxde-extra/kanotix-start-compiz @@ -1,4 +1,58 @@ #!/bin/sh -glxinfo |grep -q "direct rendering: Yes" && compiz --replace & -exit + # kanotix-start-copmpiz 0.1-3 rc1 + # Start compiz via fusion-icon + +! [ -x /usr/bin/compiz ] && exit 1 # check for compiz +[ "$(id -u)" = "0" ] && exit 2 # do not run as root +! [ -x /usr/sbin/lightdm ] && exit 3 # only start in lxde with ligthdm + +if ps ax |grep -q [f]usion-icon; then + echo "ERROR fusion-icon already running, this should not happen, killing" >&2 + pkill -9 fusion-icon +fi + +if ! [ -e ~/.config/compiz/fusion-icon ]; then + # write default config for fusion-icon, this is default, also + # this can go to etcskel, but better keep here +cat <<"_EOF_" > ~/.config/compiz/fusion-icon +[compiz options] +loose binding = false +indirect rendering = false + +[window manager] +active wm = compiz + + +_EOF_ +fi + +if [ -e ~/.nocompiz ]; then + # write openbox-config and start openbox + # keep care we have this config in case fusion-icon is started from + # menu later with the -n option +echo "compiz start disabled per user setting" >&2 +cat <<"_EOF_" > ~/.config/compiz/fusion-icon +[compiz options] +loose binding = false +indirect rendering = false + +[window manager] +active wm = openbox + + +_EOF_ + +exit 4 +fi + +# start compiz/openbox choosen from config +if glxinfo|grep -q GLX_EXT_texture_from_pixmap; then +if [ -x /usr/bin/fusion-icon ]; then + fusion-icon >/dev/null 2>&1 & # start and reload windowmanager +else + echo "ERROR fusion-icon not found, starting default" >&2 +fi +else + echo "Error no hardware support to start compiz" >&2 +fi -- cgit v1.0