summaryrefslogtreecommitdiff
path: root/kanotix-lxde-extra/kanotix-start-compiz
diff options
context:
space:
mode:
Diffstat (limited to 'kanotix-lxde-extra/kanotix-start-compiz')
-rw-r--r--kanotix-lxde-extra/kanotix-start-compiz73
1 files changed, 54 insertions, 19 deletions
diff --git a/kanotix-lxde-extra/kanotix-start-compiz b/kanotix-lxde-extra/kanotix-start-compiz
index e2ba431..48002fc 100644
--- a/kanotix-lxde-extra/kanotix-start-compiz
+++ b/kanotix-lxde-extra/kanotix-start-compiz
@@ -6,19 +6,22 @@
[ "$(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-1/
+mkdir -p ~/.config/compiz/
echo "compiz start disabled per user setting" >&2
-cat <<"_EOF_" > ~/.config/compiz-1/fusion-icon
+cat <<"_EOF_" > ~/.config/compiz/fusion-icon
[compiz options]
loose binding = false
indirect rendering = false
[window manager]
-active wm = openbox-lxde
+active wm = openbox
_EOF_
@@ -27,16 +30,26 @@ if [ -e ~/.compton ]; then
echo "starting compton" >&2
compton -b
fi
-exit 4
+"$WM" --replace &
+exit 0
+fi
+
+# check for compiz otherwise start openbox-lxde
+if ! [ -x /usr/bin/fusion-icon ]; then
+"$WM" --replace &
+exit 0
fi
-! [ -x /usr/bin/compiz ] && exit 1 # check for compiz
+if ! [ -x /usr/bin/compiz ]; then
+"$WM" --replace &
+exit 0
+fi
-# startup
-if ! [ -e ~/.config/compiz-1/fusion-icon ]; then
+# 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-1/fusion-icon
+cat <<"_EOF_" > ~/.config/compiz/fusion-icon
[compiz options]
loose binding = false
indirect rendering = false
@@ -48,28 +61,40 @@ 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 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"
+ exit 0
fi
# start compiz/openbox choosen from config
-if grep "openbox-lxde" ~/.config/compiz-1/fusion-icon; then
-STARTFLAG="-n"
+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-1/fusion-icon; then
+ #if grep "wm = compiz" ~/.config/compiz/fusion-icon; then
#compiz --replace &
#fi
@@ -77,8 +102,18 @@ if [ -x /usr/bin/fusion-icon ]; then
fusion-icon -v >/dev/null 2>&1 & # start in verbose mode
else
- echo "ERROR fusion-icon not found, starting default" >&2
+ 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