summaryrefslogtreecommitdiff
path: root/kanotix-lxde-extra/kanotix-start-compiz
diff options
context:
space:
mode:
authorHolger Paradies <retabell@gmx.de>2013-04-21 14:25:33 +0200
committerAndreas Loibl <andreas@andreas-loibl.de>2013-05-03 16:33:13 +0200
commitd48246ed65549aef3d0ede869ef5a3cb1de8efe7 (patch)
tree170d7fed0624c701cd8eea513594ff0d83380696 /kanotix-lxde-extra/kanotix-start-compiz
parent1cadfe3751a16e27a6067b26156e54788f9c4621 (diff)
downloadkanotix-packages-d48246ed65549aef3d0ede869ef5a3cb1de8efe7.zip
kanotix-packages-d48246ed65549aef3d0ede869ef5a3cb1de8efe7.tar.gz
add-fusion-icon-to-script-and-add-other-checks
Diffstat (limited to 'kanotix-lxde-extra/kanotix-start-compiz')
-rw-r--r--kanotix-lxde-extra/kanotix-start-compiz58
1 files 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