Skip to content

Instantly share code, notes, and snippets.

@SomeKittens
Created August 15, 2015 20:48
Show Gist options
  • Save SomeKittens/1a0f558195596f040c79 to your computer and use it in GitHub Desktop.
Save SomeKittens/1a0f558195596f040c79 to your computer and use it in GitHub Desktop.
#!/bin/zsh
# Noodling around with window auto-setup
# http://movingtofreedom.org/2010/08/10/arranging-windows-from-the-gnulinux-command-line-with-wmctrl/
left_monitor="0"
middle_monitor="1300"
right_monitor="3201"
get_window_id() {
return $(wmctrl -l | grep "$1" | tail -1 | cut -f1 -d" ")
}
makeBig() {
sleep 1
local wid = get_window_id
wmctrl -i -r "$wid" -e 0,$2,0,1000,1000
sleep 1
wmctrl -i -r "$wid" -b add,maximized_vert,maximized_horz
}
_echo() {
local id=$1
echo $id
}
terminator &
subl &
google-chrome &
plaidchat &
sleep 1
_echo 'hallo' $left_monitor
makeBig 'somekittens@' $left_monitor
makeBig 'Sublime Text' $middle_monitor
makeBig 'Google Chrome' $right_monitor
makeBig 'plaidchat' $right_monitor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment