This simple tutorial shows how to enable Windows 7 aero snap like functionality in Ubuntu with compiz.
First of all, open up a terminal window from Applications -> Accessories menu and install the required programs:
sudo apt-get install compizconfig-settings-manager wmctrl
and make sure Extra is being selected in Change Desktop Background -> Visual Effects tab.
Now, follow the steps below:
Step 1:
Open CCSM at System -> Preferences -> CompizConfig Settings Manager. In Genaral, tick Commands and click to go into its configuration window.
Step 2:
Copy and paste following into command line 0, command line 1, and command line 2
command line 0 :
WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-1
command line 1 :
WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$HALF,0,$HALF,-1
command line 2:
wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz
Step 3:
Head to Edge Blindings tab, set as follow:
Run Command 0 – Left
Run Command 1 – Right
Run Command 2 – Top
Step 4:
Finally, click Back and then click on General Options. Set value of Edge Trigger Delay to 500 or something you feel comfortable with.
Now, choose a window and move you cursor to left, right, or top of screen and wait (the delay 500ms) for the effect.
Check on ubuntuforums.org




Nik Reply:
March 9th, 2011 at 11:43 pm
This is awesome, but it the windows snap even if the mouse cursor comes close to an edge. Any ideas on resolving the issue?
[Reply]
Andy Reply:
April 15th, 2011 at 2:53 am
I found this really annoying too. All I did was bind them to the windows key and up, left, right buttons (super key in linux) instead of using the edge command. This is how Windows works too if you use the keyboard. It’s not a solution if you want to use the mouse, but it’s useful.
[Reply]