1 |
#!/bin/bash |
2 |
|
3 |
function runCompiz() { |
4 |
gtk-window-decorator & |
5 |
exec compiz ccp $@ |
6 |
} |
7 |
|
8 |
ISSW=`glxinfo | grep "Software Rasterizer" -c` |
9 |
|
10 |
# Try with direct rendering |
11 |
HAVETFP=`glxinfo | grep texture_from_pixmap -c` |
12 |
|
13 |
if ( [ $ISSW == 0 ] && [ $HAVETFP -gt 2 ] ); then |
14 |
runCompiz $@ |
15 |
fi |
16 |
|
17 |
# Try again with indirect rendering |
18 |
export LIBGL_ALWAYS_INDIRECT=1 |
19 |
|
20 |
HAVETFP=`glxinfo | grep texture_from_pixmap -c` |
21 |
|
22 |
if ( [ $ISSW == 0 ] && [ $HAVETFP -gt 2 ] ); then |
23 |
runCompiz $@ |
24 |
fi |
25 |
|
26 |
# Fall back to metacity |
27 |
exec metacity $@ |
28 |
|