Gnome – Keyboard Shortcut to Move Window to a Side

gnomekeyboard shortcutsUbuntuwindow-management

In Windows I can press Windows + (left/right/up/down) keys to press a window against the upper, right, down, or left side respectively. Is there an equivalent in Ubuntu?

Distro: Ubuntu 12.04, using Gnome.

Best Answer

There's no predefined shortcut, but you can make your own. Install the xdotool utility. The following commands move a window to the top and bottom respectively:

xdotool windowmove $(xdotool getwindowfocus) x 0
xdotool windowmove $(xdotool getwindowfocus) x 9999

(Some installations have the unfortunate bug that using x or y, which is supposed to leave that coordinate unchanged, doesn't take the width of the window border into account.)

To bind a command like this to a key, go to the system settings, in the “Keyboard” panel, in the “Shortcuts” tab. Select “Custom Shortcuts” and click the + sign to add a new shortcut.

Related Question