How can I snap a window in a corner with 18.04?

50,540

Solution 1

Tested and works in Ubuntu 18.04 and Ubuntu 20.04:

As you've found out, Ubuntu 18 has moved away from the Unity desktop manager which I had finally gotten used to, to Gnome desktop, which is much different. Compared to Unity, Gnome Desktop's configuration settings are all wacky. You'll need to install Gnome shell extensions.

I recommend using the Put Windows GNOME extension, like @heynnema says.
However, hknust likes the ShellTile one, so you can try it out too.

Note that Gnome Shell extensions change how your desktop works, but you configure them through your browser, which seems kind of weird at first. Your browser, in this particular case and for this particular application, acts as a front-end messaging service to communicate with the back-end configuration settings which apparently are running as a background program on your PC.

How to install the "Put Windows" GNOME shell extension to enable window tiling in Ubuntu 18:

Steps (in part borrowed from hknust's answer):

  1. Enable shell extensions (the back-end service) on your PC, and the Gnome shell extension in Chrome (the front-end configuration panel):

    sudo apt install gnome-shell-extensions chrome-gnome-shell
    
  2. In your Chrome browser, open https://extensions.gnome.org/.

  3. Search for "put windows", as shown below, and click on it. enter image description here

  4. Install it by clicking the button to the far right of it. You may see a message saying you need to install "GNOME Shell integration" from the Chrome Web store. If you do, go here and install that into Chrome: https://chrome.google.com/webstore/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep.

  5. Now you'll get that little foot-icon extension in the top-right of your Chrome: enter image description here. Click it, then click the "Installed extensions" tab at the top of the page that loads. You'll now see the "Put Windows" extension installed as shown here. Note that you may need to refresh the page to get it to show the screwdriver and wrench icon once you've installed it: enter image description here.

  6. Configure it by clicking the little screwdriver and wrench icon under the yellow arrow I made in the image above. Notice the default keyboard shortcuts are set like so: enter image description here Super (ie: Windows key) + Keypad 7, for instance, will tile the selected window to the top-left corner of your screen.

  • If you have an ultrabook or smaller laptop that does not have a Numpad/Keypad, then I recommend using the following settings instead (where the "Super" key is your "Windows" key): enter image description here
  • If you use the laptop/ultrabook settings that I recommend just above, note that the Alt + Super + S keyboard shortcut will interfere with Ubuntu's default Screen Reader keyboard shortcut, which is the same. So, go to Ubuntu's Settings --> Devices --> Keyboard --> click the search icon (magnifying glass) at the top-right side of the window, search for "Alt+Super+S", you'll see the option for "Turn screen reader on or off", which is assigned to this shortcut sequence. Click it, then press the Backspace key to delete this shortcut, then click the green "Set" button that appears. Done! The shortcut for this option now shows "Disabled" in bold instead of "Alt+Super+S" like it used to show. Here's what that looks like: enter image description here
  • Once you've done this, the Put Windows Alt + Super + S keyboard shortcut to center or maximize the window may be temporarily broken, so you need to toggle this extension off and then back on again to refresh and fix it. Go back to Chrome (or whatever internet browser you used to configure this) --> click the black footprint ("Open GNOME Shell extensions website" button: enter image description here) in the top-right of your browser --> Find your "Put Windows" entry as shown here: enter image description here, and click the "ON" slider to toggle this extension off, then click it again to toggle it back on. Now try your Put Windows window snap shortcuts and it should all be working! Alt + Super + S and the other shortcuts should all work fine now.
  • You will now no longer have a conflict between this keyboard shortcut and the Put Windows shortcut to "Move to center/maximize".
  1. Remember, even though it seems odd at first, the browser plugins and tools are simply the front-end GUI interface to configure your computer's GNOME desktop settings. This fact alone can seem confusing at first.

BUG NOTE/WEIRD BEHAVIOR: If you are trying to snap a window to a corner but its size is off, first snap it to the center (Alt + Super + S), then snap it to the corner (ex: Alt + Super + Q to move to upper-left corner), and it will now be the right size to allow 4 windows to be seen at once--one in each corner, as snapping it to the center first also gets it to be the right size--ie: exactly 1/4 of the screen area.

Done!

Related:

  1. Bug fix you might need to restart Gnome in the future in case Put Windows ever quits working: GNOME Shell Extension Put Windows stopped working

Solution 2

Apparently Gnome supports the different tiling behaviors through extensions

Enable shell extensions and browser integration first

sudo apt install gnome-shell-extensions chrome-gnome-shell

In the browser open https://extensions.gnome.org/ and install the plugin

I wanted the same corner behavior you were looking for, so I installed the ShellTile extension

https://extensions.gnome.org/extension/657/shelltile/

Solution 3

The Put Windows GNOME extension will do what you ask. See https://extensions.gnome.org/extension/39/put-windows/. Once you switch it "ON", you can configure it at https://extensions.gnome.org/local/.

Share:
50,540

Related videos on Youtube

François Martineau
Author by

François Martineau

Updated on September 18, 2022

Comments

  • François Martineau
    François Martineau almost 2 years

    Super + left/right snaps windows to fit half the screen. I'd like to be able to snap four windows in all corners. CompizConfig Settings Manager doesn't seem to be an option since 18.04 uses the GNOME desktop.

  • N0rbert
    N0rbert almost 6 years
    Extension? Why? This functionality was out-the-box for years. GNOME R.I.P.
  • Boris Hamanov
    Boris Hamanov almost 6 years
    @N0rbert you're right... live and learn... however this GNOME extension is configurable, and has even more options than what's built into GNOME already.
  • vanadium
    vanadium almost 6 years
    ...and it is hoped that, after half tiling, more tiling features like quarter tiling will come to native Gnome Shell at some time in the future.
  • Gordon Wrigley
    Gordon Wrigley almost 6 years
    What is not apparent from the ShellTile page is that in addition to it's window grouping thing it also does "edge tiling" which is exactly what I want. The one little quirk is centre top of the screen maximises, but to either side of that it will maximise to the top half of the screen.
  • pomsky
    pomsky over 5 years
    Works with Firefox (the pre-installed default) too, not just Chrome.
  • Vitor Abella
    Vitor Abella over 5 years
    Put windows didnt work for me, but shellTile did :)
  • Ziv
    Ziv about 5 years
    Once I snap a window to the any of the sides, I can't release it from there using the mouse. Is there a setting so I can still move them?
  • mcExchange
    mcExchange almost 5 years
    Error upon opening https://extensions.gnome.org/extension/39/put-windows/: "We cannot detect a running copy of GNOME on this system, so some parts of the interface may be disabled. See our troubleshooting entry for more information."
  • Gabriel Staples
    Gabriel Staples almost 5 years
    Sounds like you're not running gnome. Are you running an older Ubuntu version, or a different window manager than gnome?
  • k_g
    k_g almost 5 years
    put windows stopped working with the latest update
  • Gabriel Staples
    Gabriel Staples almost 5 years
    As of when? I just reinstalled the latest Ubuntu 18 on a new computer, did all updates, and configured Put Windows per my answer here about 2 weeks ago.
  • andras
    andras over 4 years
    2 things: 1) Chrome extension is needed and it extensions.gnome.org did not give a link. 2) Put windows has to be enabled undex gnome-tweaks > 'Put windows'
  • Magnus
    Magnus over 4 years
    I'm very confused about what Chrome, Firefox or any web browser has to do with my desktop manager. Is there something I should read up on?
  • Gabriel Staples
    Gabriel Staples over 4 years
    @Magnus, I explain it briefly in the 3rd paragraph of my answer. It really confused me a lot too. Just know that a browser generally displays what comes from a remote server. In this case, however, the server serving the page is your own computer, and the page it's serving contains your computer settings. The browser is just a GUI program used to interface to your computer settings, rather than to a remote server to view the internet.
  • Mike Tsubasa
    Mike Tsubasa over 2 years
    putwidows can move windows into top-left,top-right etc in 8 different configurations and shell tile only allows 4 differnet configuration: top,bottom,left and right.Hope that helps the future me
  • Gabriel Staples
    Gabriel Staples over 2 years
    @MikeTsubasa, "put windows" actually has far more snapping positions than 8. It has 26 snapping positions. There are 9 position keys on your keyboard. I set them up to QWE, ASD, ZXC, as my answer shows. All of those keys except the center key (S), have 3 snapping positions if you press them multiple times. The center key (S) has only 2 swapping positions: center small, or full-screen. So, that makes 8*3 + 2 = 26 snapping positions.
  • Gabriel Staples
    Gabriel Staples over 2 years
    Additionally, you can use Alt + Windows + W or X or A or D as though they were arrow keys, to snap a window over onto another monitor, when you have multiple monitors. Just press the sequence repeatedly to slowly snap a window over and onto a new monitor, or use Shift + Windows + Arrow Keys (in the appropriate direction towards your other monitor) to do it rapidly in one motion.