Skip to content

Instantly share code, notes, and snippets.

@ryansch
Created May 21, 2010 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryansch/409176 to your computer and use it in GitHub Desktop.
Save ryansch/409176 to your computer and use it in GitHub Desktop.
Launches xterms
#!/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