Created
May 21, 2010 18:01
-
-
Save ryansch/409176 to your computer and use it in GitHub Desktop.
Launches xterms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SIZE=`xdpyinfo | grep dimensions | cut -c 18-26` | |
main=off | |
secondary=off | |
displaylink=off | |
offset=0 | |
function launch_terms { | |
width=$1 | |
length=$2 | |
start=$3 | |
spacing=$4 | |
xterm -geometry ${width}x${length}+$(($start + 0))+0 & | |
xterm -geometry ${width}x${length}+$(($start + $spacing))+0 & | |
xterm -geometry ${width}x${length}+$(($start + $(($spacing * 2)) ))+0 & | |
} | |
function launch_main { | |
if [ "$main" == "on" ] ; then | |
launch_terms 105 84 $offset 634 | |
fi | |
} | |
function launch_secondary { | |
if [ "$secondary" == "on" ] ; then | |
launch_terms 92 78 $(($offset + 1920)) 556 | |
fi | |
} | |
function launch_displaylink { | |
if [ "$displaylink" == "on" ] ; then | |
launch_terms 92 78 0 556 | |
fi | |
} | |
while [ $# -gt 0 ] | |
do | |
echo $1 | |
case "$1" in | |
"Main" | "main") main=on;; | |
"Secondary" | "secondary") secondary=on;; | |
"DisplayLink" | "displaylink") displaylink=on;; | |
esac | |
shift | |
done | |
if [ "$SIZE" == "1920x1178" ] ; then | |
launch_main | |
fi | |
if [ "$SIZE" == "3600x1200" ] ; then | |
launch_main | |
launch_secondary | |
fi | |
if [ "$SIZE" == "5280x1200" ] ; then | |
offset=1680 | |
launch_main | |
launch_secondary | |
launch_displaylink | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment