Skip to content

Instantly share code, notes, and snippets.

@SergKolo
Created June 22, 2016 07:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SergKolo/b4ca47e820614ea4f6b3e1a4295fa152 to your computer and use it in GitHub Desktop.
Save SergKolo/b4ca47e820614ea4f6b3e1a4295fa152 to your computer and use it in GitHub Desktop.
#!/bin/bash
# run script like so: bash thirds.sh NUMBER
# where NUMBER is 0,1 or 2
# 0 is left, 1 is center, 2 is right
get_screen_geometry()
{
# determine size of the desktop
xwininfo -root | \
awk -F ':' '/Width/{printf "%d",$2/3}/Height/{print $2}'
}
xdotool getactivewindow windowsize $(get_screen_geometry )
xdotool getactivewindow windowmove \
$(get_screen_geometry | awk -v POS=$1 '{ printf "%d ", POS*$1 }' ) 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment