annotate bin/swapscreens.sh @ 177:6ae566bb1a99

add an example of lack of python closures
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 03 Nov 2011 10:39:22 -0700
parents 206d7550bf45
children 71345f4de3ce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
139
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/bin/bash
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 # swap screens between internal laptop monitor and external monitor
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 INTERNAL="LVDS1"
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 EXTERNAL="VGA1"
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 INTERNAL_MODE="1366x768"
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 EXTERNAL_MODE="1600x1200"
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 xwininfo -root | grep "geometry $EXTERNAL_MODE"
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 if [ $? -eq 0 ]
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 then
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 xrandr --output $EXTERNAL --off --output $INTERNAL --mode $INTERNAL_MODE
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 else
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 xrandr --output $INTERNAL --off --output $EXTERNAL --mode $EXTERNAL_MODE
206d7550bf45 add a program for swapping screens
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 fi