Results 1 to 1 of 1

Thread: Compiz Quartile Snap: Windows 7's Snap's Distant Cousin

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Beans
    68
    Distro
    Ubuntu 10.04 Lucid Lynx

    Compiz Quartile Snap: Windows 7's Snap's Distant Cousin

    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
    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,0,0,$HALFWIDTH,$HALFHEIGHT
    bottom-left
    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,0,$HALFHEIGHT,$HALFWIDTH,$HALFHEIGHT
    top-right
    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,0,$HALFWIDTH,$HALFHEIGHT
    bottom-right
    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
    If you have any suggestions to make this better, please let me know!

    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
    Code:
    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
    Right Snap
    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
    Also for damn good measure, here is Google's cache of the original link.

    Now, enjoy
    Last edited by boaty; September 25th, 2010 at 03:27 AM. Reason: Fixed a broken link, pointed out a better version of the half-snaps.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •