#!/bin/sh # kanotix-start-copmpiz 20140329 # Start compiz via fusion-icon [ "$(id -u)" = "0" ] && exit 2 # do not run as root ! [ -x /usr/bin/lxde-logout ] && exit 3 # only start in lxde 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 mkdir -p ~/.config/compiz-1/ echo "compiz start disabled per user setting" >&2 cat <<"_EOF_" > ~/.config/compiz-1/fusion-icon [compiz options] loose binding = false indirect rendering = false [window manager] active wm = openbox-lxde _EOF_ if [ -e ~/.compton ]; then echo "starting compton" >&2 compton -b fi exit 4 fi ! [ -x /usr/bin/compiz ] && exit 1 # check for compiz # startup if ! [ -e ~/.config/compiz-1/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-1/fusion-icon [compiz options] loose binding = false indirect rendering = false [window manager] active wm = compiz _EOF_ fi STARTFLAG="" # catch if system is already running 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 fusion-icon $STARTFLAG >/dev/null 2>&1 & exit 5 fi # force no compiz start with llvmpipe if glxinfo|grep -q llvmpipe; then echo "disable compiz on llvmpipe" >&2 sed -i s/"active wm = compiz"/"active wm = openbox-lxde"/ ~/.config/compiz-1/fusion-icon STARTFLAG="-n" fi # start compiz/openbox choosen from config if grep "openbox-lxde" ~/.config/compiz-1/fusion-icon; then STARTFLAG="-n" fi if glxinfo|grep -q GLX_EXT_texture_from_pixmap; then if [ -x /usr/bin/fusion-icon ]; then echo "starte fusion-icon" #if grep "wm = compiz" ~/.config/compiz-1/fusion-icon; then #compiz --replace & #fi #fusion-icon -n >/dev/null 2>&1 & # start and do not reload windowmanager fusion-icon -v >/dev/null 2>&1 & # start in verbose mode else echo "ERROR fusion-icon not found, starting default" >&2 fi else echo "Error no hardware support to start compiz" >&2 fi