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.

5
  • 1
    "Move around" or being pressed against the upper, right, down, left side?
    – Braiam
    Dec 5, 2013 at 1:45
  • @Braiam, what you said :P Dec 5, 2013 at 1:51
  • 3
    In GNOME shell only Ctrl + Super + Left/Right works, others don't.
    – Braiam
    Dec 5, 2013 at 2:47
  • You should clarify in your title and question body what desktop environment or window manager you are using. Your answer will be specific to that and not the distro. Ubuntu probably means you are using Unity, but I wont assume that.
    – casey
    Dec 5, 2013 at 5:24
  • Is there an equivalent in Windows? May 18, 2021 at 9:17

10 Answers 10

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.

5
  • 1
    Somehow the left and right sides aren't working. Everything else seems to work. Any ideas why?
    – khatchad
    Aug 21, 2017 at 21:12
  • 2
    To get left/right to work, I just used <kbd>Super</kbd>+<kbd>Left Arrow</kbd>. That seemed to pull the window over. Also this worked to bring it from offscreen
    – Jonathan
    Nov 16, 2017 at 22:46
  • 4
    Just a tip, Super = "Windows" key on most keyboards
    – Justas
    Jan 25, 2018 at 21:29
  • 3
    Aren't these shortcuts for Unity, not for GNOME Shell?
    – Flimm
    Mar 16, 2018 at 11:30
  • 2
    In Gnome 3.28 Shift + Super + Arrow moves window between screens. Using just Super + Arrow changes window's size and location in current screen.
    – Noam Manos
    May 2, 2022 at 9:13
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

5
  • 1
    You can condense Alt+space M into Alt+F7 (but it's less easy to memorize). But that's not quite the same thing, you have to align the window with the screen border manually. Dec 5, 2013 at 22:49
  • 1
    And the window gets moved in steps, so won't be able to to fit snuggly against a side Jul 18, 2014 at 4:51
  • 1
    I'm running the Prism window manager in Ubuntu and Alt+Spacebar is the default combination for opening the search bar. FYI for prism users.
    – Brandon
    Jan 16, 2017 at 15:13
  • thanks for this. Accidentally moved the window so the toolbar was out of the field of view. Oct 12, 2017 at 20:59
  • No longer works in Gnome on Ubuntu 17.10
    – Jonathan
    Nov 16, 2017 at 22:44
12

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
2
  • Ctrl + Alt + Keypad for others movements don't work in 18.04, any idea how to fix? Jul 7, 2018 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 9, 2018 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.

2
  • 1
    a somewhat cleaner way is using getactivewindow: xdotool getactivewindow windowmove x 0
    – glS
    Apr 27, 2015 at 13:11
  • @glS You can also use getwindowfocus in your suggestion
    – sappjw
    Feb 10, 2016 at 21:29
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
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".

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...).

2
  • It's possible to change the Ctrl + Alt + Keypad for others keys? Like Ctrl + Alt + Shift + Keypad
    – Arnold Roa
    Nov 2, 2017 at 1:13
  • 1
    I have no idea why this had a downvote. This exactly what I was looking for. Have an upvote to get back in there. Mar 26, 2018 at 20:44
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.

0

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

1
  • 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 9, 2021 at 9: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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .