How to enable Windows 7 Aero Snap in Ubuntu [Tweak]

Although I am not a “Windows” fan, I find the Windows 7 aero snap feature very useful. If you have had the s After a series of experimental tries, it finally works in Ubuntu.

Let’s Get Started

This guide will show you how to enable Windows 7 snap in Ubuntu via Compiz setting manager.

Step 1:

Well, you will need Compiz Manager to enable the snap feature. In case you don’t have Compiz manager, open the terminal and type:

sudo apt-get install compizconfig-settings-manager wmctrl

Note: Extra option should be selected in Change Desktop Background -> Visual Effects tab

Step 2:

Open Compiz setting manager (System -> Preferences -> CompizConfig Settings Manager). In Genaral, tick Commands option and open its configuration window.

 

Step 3:

Paste following code in command line 0, command line 1, and command line 2 repectively.

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 4:

Switch to edge binding tab and assign the following

Run Command 0 – Left
Run Command 1 – Right
Run Command 2 – Top

 

Step 5:

Head back to  General Options and set the value of Edge Trigger Delay to 1000

Note: Now move your cursor to left, right, or top of screen and wait (the delay 1000ms) for the snap effect.

Update: You can also enable Window Snap using Compiz Grid

You can leave a response, or trackback from your own site.

SUBSCRIBE TO OUR DAILY RSS FEED!

RELATED POSTS

3 Responses to “How to enable Windows 7 Aero Snap in Ubuntu [Tweak]”

  1. [...] configured in CCSM. It adds effects when you drag the window to the left/right/top of the screen (window snap similar to Windows). This can also be configured in previous versions of [...]

  2. Steve Kun says:

    First of all, thanks for the post.

    I had problems caused by cut-and-pasting the commands. Symptoms: the snap silently didn’t work. The fix was to replace the quote characters in the commands with apostrophes:
    E.g. grep ‘dimensions:’ -> grep ‘dimensions:’

    After editing the commands, you can check whether they work by cut-and-pasting them into a terminal window.

Leave a Reply

Popup By Puydi