So, inspired by the Compiz half-screen snaps, I decided to try to work together quartile snaps. Using this method, you can have assign these commands to each corner.
top-left
bottom-leftCode:WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALFWIDTH=$(($WIDTH/2)) && HEIGHT=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 2 -d 'x' | cut -f 1 -d p` && HALFHEIGHT=$(($HEIGHT/2)) && wmctrl -r :ACTIVE: -e 0,0,0,$HALFWIDTH,$HALFHEIGHT
top-rightCode:WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALFWIDTH=$(($WIDTH/2)) && HEIGHT=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 2 -d 'x' | cut -f 1 -d p` && HALFHEIGHT=$(($HEIGHT/2)) && wmctrl -r :ACTIVE: -e 0,0,$HALFHEIGHT,$HALFWIDTH,$HALFHEIGHT
bottom-rightCode:WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALFWIDTH=$(($WIDTH/2)) && HEIGHT=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 2 -d 'x' | cut -f 1 -d p` && HALFHEIGHT=$(($HEIGHT/2)) && wmctrl -r :ACTIVE: -e 0,$HALFWIDTH,0,$HALFWIDTH,$HALFHEIGHT
If you have any suggestions to make this better, please let me know!Code:WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALFWIDTH=$(($WIDTH/2)) && HEIGHT=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 2 -d 'x' | cut -f 1 -d p` && HALFHEIGHT=$(($HEIGHT/2)) && wmctrl -r :ACTIVE: -e 0,$HALFWIDTH,$HALFHEIGHT,$HALFWIDTH,$HALFHEIGHT
Enjoy!
Edit:
The link above is broken. Here is a link to the lifehacker page referencing the method.
Down the page a little are the two commands (actually slightly different than the original, but better; they prevent overlapping).
Left Snap
Right SnapCode:WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$((($WIDTH/2)-10)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-1
Also for damn good measure, here is Google's cache of the original link.Code:WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$((($WIDTH/2)-12)) && HALFP=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$HALFP,0,$HALF,-1
Now, enjoy![]()



Adv Reply

Bookmarks