Skip to content

Instantly share code, notes, and snippets.

@josephwegner
Created March 21, 2011 20:22
Show Gist options
  • Save josephwegner/880144 to your computer and use it in GitHub Desktop.
Save josephwegner/880144 to your computer and use it in GitHub Desktop.
Switches between gnome-panel configurations for variable monitor configurations.
Main() {
NR_OF_MONITORS=$(xrandr | grep -v disconnected | grep -c connected)
if [ $NR_OF_MONITORS = 1 ]; then
oneMon
fi
if [ $NR_OF_MONITORS = 2 ]; then
twoMon
fi
}
oneMon() {
echo "One Monitor"
gconftool-2 --load $HOME/def_panels/one.xml
}
twoMon() {
echo "Two Monitors"
xrandr --addmode VGA1 1600x900
xrandr --output VGA1 --mode 1600x900 --rate 60
gconftool-2 --load $HOME/def_panels/two.xml
}
Main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment