#!/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 # This is the legacy window-manager for lxde WM="openbox-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/ 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_ if [ -e ~/.compton ]; then echo "starting compton" >&2 compton -b fi "$WM" --replace & exit 0 fi # check for compiz otherwise start openbox-lxde if ! [ -x /usr/bin/fusion-icon ]; then "$WM" --replace & exit 0 fi if ! [ -x /usr/bin/compiz ]; then "$WM" --replace & exit 0 fi # startup with compiz and fusion-icon 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 STARTFLAG="" # 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"/ ~/.config/compiz/fusion-icon STARTFLAG="-v" fi # if on virt start with openbox if command -v systemd-detect-virt > /dev/null ;then VIRT=$(systemd-detect-virt) if ! [ "$VIRT" = "none" ]; then echo "disable compiz on virtual machine" >&2 sed -i s/"active wm = compiz"/"active wm = openbox"/ ~/.config/compiz/fusion-icon STARTFLAG="-v" fi fi # 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 0 fi # start compiz/openbox choosen from config if grep "openbox" ~/.config/compiz/fusion-icon; then STARTFLAG="-v" 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/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 if [ -e ~/.compiz ]; then sleep 3 # test to play around with sleep values emerald --replace & compiz --replace & >/dev/null #sleep 1 lxpanelctl restart fi echo "Start without fusion-icon" >&2 "$WM" --replace & fi else echo "Error no hardware support to start compiz" >&2 "$WM" --replace & fi