Skip to content

Instantly share code, notes, and snippets.

@Gen2ly
Created May 31, 2012 02:29
Show Gist options
  • Save Gen2ly/2840553 to your computer and use it in GitHub Desktop.
Save Gen2ly/2840553 to your computer and use it in GitHub Desktop.
Toggle compositing effects of the Unity desktop
#!/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