Created
July 10, 2011 10:24
-
-
Save stedolan/1074445 to your computer and use it in GitHub Desktop.
Switch Compiz on/off
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dir="$1" | |
if pidof compiz > /dev/null; then | |
current=on | |
else | |
current=off | |
fi | |
if [ -z "$dir" ]; then | |
if [ $current = on ]; then | |
dir=off | |
else | |
dir=on | |
fi | |
fi | |
if ! [ "$dir" = "off" -o "$dir" = on ]; then | |
echo "Usage: $0 off [turn off compiz]" | |
echo " $0 on [turn on compiz]" | |
echo " $0 [toggle compiz]" | |
exit 1 | |
fi | |
if [ $dir = $current ]; then | |
echo "Compiz is already $dir!" | |
exit 0 | |
fi | |
echo "Turning compiz $dir" | |
if [ "$dir" = "on" ]; then | |
compiz --replace & | |
else | |
metacity --replace & | |
fi | |
disown |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment