Enable Windows 7 Aero Snap in Ubuntu


In Windows 7, you can click and drag a window to the left or right edge of the desktop and it will fill half of the screen, or snap a window to the top edge of the desktop and it will be maximized.

In Ubuntu, you can click and drag a window to the left, right or top edge of the desktop to achieve the same result.

In addition to CompizConfig Settings Manager, install WmCtrl if not added:
– go to Applications (or Main Menu) > Accessories > Terminal.
– enter sudo apt-get install wmctrl
– enter password when prompted.
– go To System > Preferences > CompizConfig Settings Manager.
– select “General” from the left panel and click “Commands”.
In Command line 0, 1 and 2, paste the following codes:

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

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

Command line 2, paste:

wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz

In the same window, click “Edge Bindings” tab.
Change Run Command 0, 1 and 2 from “None” to “Left”, “Right” and “Top” respectively.
Click “Back” button and select “General Options”, change “Edge Trigger Delay” to about 500. AddThis mp3 link

One thought on “Enable Windows 7 Aero Snap in Ubuntu

  1. Brandon Sperger

    Dated post. Let me update. Either upgrade to 11.04 which has this feature (optimized visuals too!) and sacrifice Compiz Cube for it, or use Compiz’s inbuilt tool for this:

    In Compiz Settings Manager find the option Grid under the Window Management heading. Do not click the check box YET. Click on it to open it up. You will see options like ‘Put Center’ and ‘Put Left’ Assign any hotkeys you want, and then enable :). I use ‘ctrl+menu’ and ‘ctrl+menu’, respectfully.

    Additionally, If you want to full-screen windows WITHOUT over-riding inbuilt ‘f11’ or ‘ctrl/alt+f’ functionality of specific programs (that are designed to work that way), click on Extra WM Actions. Once there assign a hotkey for ‘Toggle Fullscreen’ and enable. I personally use ‘ctrl+F11’.

    Like

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s