Mercurial > hg > config
annotate bin/swapscreens.sh @ 185:952ba8de70d8
more characters
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 15 Dec 2011 09:47:09 -0800 |
parents | 206d7550bf45 |
children | 71345f4de3ce |
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 |