summaryrefslogtreecommitdiff
path: root/kanotix-lxde-extra/kanotix-start-compiz
blob: 982ea91a3378e202f7bf2b18ef713da4723b5e65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh

 # 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-lxde


_EOF_

if [ -e ~/.compton ]; then
echo "starting compton" >&2
compton -b
fi
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