How can I change the alt+middle-mouse-button resize to alt+right-mouse-button?

I love how you can resize windows by pressing alt+middle-mouse-button and drag.

Though now I got a mouse which doesn't support pressing the middle mouse button..

How do I do to change the combination from alt+middle-mouse-button to alt+right-mouse-button?

(On Ubuntu 11.04 with unity)


Follow these steps:

  • To open dconf-editor, Hit Alt+F2, type dconf-editor and hit Enter.

  • In dconf-editor goto: orggnomedesktopwmpreferences and enable ☑ resize-with-right-button.

    enter image description here


  1. You need to get and install ccsm (Compiz Config Settings Manager).

    sudo apt-get install compizconfig-settings-manager
    
  2. Go to Window Management --> Resize window .

    CompizConfig Settings Manager

Note: Changing Button2 to Button3 or 1 may give you a conflict message. If so, choose "Disable Window Menu". However, Alt+F8 Will give you the same result. key binding conflict dialog


You can do this using compizconfig-settings-manager.

If you dont already have this installed, use Software Center and search for this package.

In dash type ccsm and then in the Window Management section click on "Resize Window".

At the bottom of this window is "Initiate Window Resize" - you'll notice that Button2 is the default. You can change this to whichever button you want.


The following script extract will do just that (and works on both new Unity and old Gnome):

#!/bin/bash
gconftool-2 -s -t bool /apps/metacity/general/resize_with_right_button true
gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true

I have a script that I run whenever I install a fresh Ubuntu and the above is part of it; makes it nice and easy to restore my default settings :)