Created
May 31, 2012 02:29
-
-
Save Gen2ly/2840553 to your computer and use it in GitHub Desktop.
Toggle compositing effects of the Unity desktop
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 | |
# Toggle compositing effects of the Unity desktop | |
set -x | |
unity_2d="unity-2d-panel unity-2d-shell unity-2d-places unity-2d-launcher unity-2d-spread " | |
#unity_2d="unity-2d-panel unity-2d-shell" | |
start_2d() { | |
# Replace window manager | |
metacity --replace & | |
sleep 2 | |
# Quit desktop effects | |
killall -q compiz | |
sleep 1 | |
# Start Unity 2d | |
for p in $unity_2d; do | |
"$p" & | |
sleep 1 | |
done | |
clear | |
} | |
start_3d() { | |
# Quit 2d | |
kill -q $unity_2d | |
# Start 3d | |
unity --replace & | |
#compiz --replace & | |
clear | |
} | |
if ps -u "$USER" | grep -q [m]etacity; then | |
# Unity 2D is currently running. | |
start_3d | |
else | |
# Unity 3D is currently running. | |
start_2d | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment