Mercurial > hg > config
annotate bin/swapscreens.sh @ 333:998d3c276b25
http://askubuntu.com/questions/168117/how-to-automatically-add-meta-tags-to-screenshot?rq=1
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 18 Jun 2013 14:44:14 -0700 |
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 |