Submit A Tip Alternative Tip Form

How To Enable Aero Snap in Ubuntu Linux Using Compiz

Ubuntu users can get a the cool functionality of Windows 7′s “Aero Snap” with a few copy’s and a few pastes thanks to an awesome tutorial on the UbuntuForums by forum-er gotsanity. Props and cookies go to him for this.

What Is Aero Snap And Why Should I Use It?

For those who don’t know what Aero Snap is i shall try and sum it up in on sentence: Aero Snap allows you to minimize, maximize and resize windows by simply drag-dropping them to the sides of the screen.

It’s useful for comparing the contents of two windows side-by-side.

For example you have two tabs in Google Chrome open but want to view the contents side-by-side rather than having to switch tabs. Easy. Peel of one of the tabs, drag it to the left – BAM! Drag the second window to the right and – BOOM! There they are: -

Drag them away and ta-da! they resize back.

Enable “Aero Snap” In Ubuntu

You Will Need Compiz enabled and the following applications installed: -

sudo apt-get install compizconfig-settings-manager wmctrl

Now you’re all set to begin.

  • Open the Compiz Config Settings Manager (ALT+F2 ccsm, system > preferences > CompizConfig…, etc)
  • Select the “Commands” option.
  • In  ‘Command Line 0′ paste: -
WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-1
 
  • In ‘Command Line 1′ paste: -
WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$HALF,0,$HALF,-1
 
  • And in ‘Command Line 2′ paste: -
wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz

It should now look something like this: -

Now choose the ‘Edge Bindings’ tab at the top and set the following: -

  • Run Command 0 – Set To Left
  • Run Command 1 – Set To Right
  • Run Command 2 – Set To Top

Click on the back button and go to ‘General options’.

Set the ‘Edge Trigger Delay’ to something around 400 – 500 by dragging the slider to the right.

Now all you have to do is drag a window to one of the specified sides and your window will automatically resize.

{thanks to Grayson & ubuntuforums.org}