36

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.

AdminBee
  • 21,637
  • 21
  • 47
  • 71

10 Answers10

26

Taken from comments, here's the answer that helped me, no tools needed.

Ubuntu 16.04 LTS.

Ctrl+Super+Left Arrow - Dock to the left side of your monitor

Ctrl+Super+Right Arrow - Dock to the right side of your monitor

Ctrl+Super+Up Arrow - Maximize the window

Ctrl+Super+Down Arrow (When docked or maximized) - Restore the window.

Ctrl+Super+Down Arrow (When restored) - Minimize the window.

This won't move windows between monitors like it does in Windows. I haven't figured out a way to do that.

Brandon
  • 411
  • 4
  • 9
15

Yes...there is a way in Linux to do so ( and to your surprise, it will also work in Windows too )

Just press Alt+Spacebar then hit the key m and then move wherever you want by usin the arrow keys. Once you done, hit the Enter key.

And, oh yeah, It will work if and only if the window in question is not fully maximized

SHW
  • 14,454
  • 14
  • 63
  • 101
9

tested in the current gnome 3.28 on ubuntu 18.04

  • SUPER+ moves the window to the left
  • SUPER+ moves the window to the right
Kevin Lemaire
  • 1,629
  • 1
  • 12
  • 28
user8162
  • 190
  • 1
  • 4
  • Ctrl + Alt + Keypad for others movements don't work in 18.04, any idea how to fix? – Pratik Gaikwad Jul 07 '18 at 18:23
  • CTRL+ALT+↓/↑ for workspace switching is working fine. For others, you can define it in settings→keyboard. Note that ubuntu now used gnome. – user8162 Jul 09 '18 at 15:39
6

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.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
3

If you use xbindkeys and have xdotool utility installed, you can add the following lines to your ~/.xbindkeysrc to enable win+left and win+right to move current active window to the left/right half of the screen:

"xdotool windowsize $(xdotool getwindowfocus) 50% 100% && xdotool windowmove $(xdotool getwindowfocus) 0 y"
    Mod2+Mod4 + Left

"xdotool windowsize $(xdotool getwindowfocus) 50% 100% && xdotool windowmove $(xdotool getwindowfocus) 9999 y"
    Mod2+Mod4 + Right
t7ko
  • 475
  • 1
  • 3
  • 11
2

In Ubuntu 20.04, the shortcuts can be changed by opening up Keyboard Shortcuts (e.g. by pressing Super and searching for it) and editing "View split on right" and "View split on left" and "Maximize window" and "Restore window".

Janus Troelsen
  • 1,463
  • 1
  • 15
  • 27
1

There's a more flexible builtin way, as Ctrl+Super+Arrow doesn't allow a window to take only a quarter of the screen (for example top left or bottom right).

You can use Ctrl+Alt+Keypad. Which keypad number is pressed (1, 2...) will determine the position of the window (bottom left, bottom...).

coyotte508
  • 465
  • 4
  • 7
0

I'm using ubuntu 12.04 gnome classic, but i think it's the same thing for all ubuntu.

Here is what I do:

First of all, you need to install "stiller".

1) Open terminal Ctrl+Alt+T and type:

sudo add-apt-repository ppa:fossfreedom/xfwm4
sudo apt-get update
sudo apt-get install stiler

Second, now you can edit keyboard shortcuts by:

2) Go to "System Settings" -> Keyboard -> Shortcuts ->

Press "Custom Shortcuts" (at the left pane)

Press "+" symbol (at down left of the window)

3) In the "Custom Shortcut" window that is just open, type:

(for example)

"View split on left" as a name, and

"stiler.py left" as a command, and press "Apply".

4) Press "Disable" (it's on the same line with the "View split on left" you just created)

and press the keys combination "Ctrl+Supper+Left" on your keyboard.


  • The same thing for any combination shortcut as for example:

"View split on Right" as a name,

"stiler.py right" as a command,

"Ctrl+Supper+Right" as a keys combination.

OR

"Gnome Search Tool" as a name,

"gnome-search-tool" as a command,

"Super+F" as a keys combination.

OR

"System Monitor" as a name,

"gnome-system-monitor" as a command,

"Ctrl+Shift+Esc" as a keys combination.

This is just an example, it's up to you which name, command, and keys combination you need to use.

AntonyMan
  • 1
  • 1
0

There's a quite convenient Gnome extension to achieve the behavior w/o frustration: https://extensions.gnome.org/extension/39/put-windows/

  • 1
    Welcome to the site, and thank you for your contribution. You may want to add a short summary on how to configura this extension to achieve the OPs desired behavior. – AdminBee Jun 09 '21 at 09:52
0

This is still relevant as of 2022, so here's a solution:

The actions are available, but they are not mapped.

In MATE or Gnome, map them with "Keyboard Shortcuts", aka mate-keybinding-properties or gnome-keybinding-properties.

Michał Leon
  • 272
  • 2
  • 10