Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 2088  / 2 Years ago, fri, september 30, 2022, 8:16:50

I wrote this popular answer for Ubuntu 18.04 and 20.04, but now it won't work on Ubuntu 22.04 due to Wayland.


https://github.com/negesti/gnome-shell-extensions-negesti#wayland--wnck:



Because of this dependency and the different concepts of wayland and X11 to identify applications (wm_class vs. application_id) Wayland is not supported!



And from https://extensions.gnome.org/extension/39/put-windows/:


enter image description here


Any ideas, fixes, or alternatives?


This is something but isn't very useful, in my 2 minutes of playing with it: https://help.ubuntu.com/stable/ubuntu-help/shell-windows-states.html.en


In case this matters, a fresh Ubuntu 22.04 install has GNOME Shell 42.5, as shown by gnome-shell --version.


WinTile looks promising, but no luck so far. I opened an issue: https://github.com/Fmstrat/wintile/issues/91#issue-1504090370


More From » 22.04

 Answers
0

I have discovered how to install and use two really good extensions for this:



  1. Awesome Tiles - allows window snapping via shortcut keys, just like "Compiz" in Unity in Ubuntu 14.04 and 16.04, and "Put Windows" in Gnome in Ubuntu 18.04 and 20.04.

  2. WinTile (following my custom "WinTile Reloaded" installation instructions below) - allows resizing, tiling, and snapping windows just by dragging them to the edges or corners of a screen--same as in modern versions of Windows apparently. Very useful and fast for mouse users. Tested and works in Ubuntu 18.04, 20.04, and 22.04.


I like to use both of these extensions simultaneously. I've tested both of them in Ubuntu 22.04 with both the X11 and Wayland window manager servers, and both extensions work in both cases.


Extension 1: Awesome Tiles (uses keyboard shortcuts to resize and snap windows to edges and corners)


Tested in Ubuntu 22.04 with both the X11 and Wayland window manager servers.


Due to a known bug in Ubuntu 22.04, you can not install "Awesome Tiles" from the browser here: https://extensions.gnome.org/. Instead, install it from the gnome-shell-extension-manager:


# install it
sudo apt update
sudo apt install gnome-shell-extension-manager

Open its GUI by pressing the Windows key and typing "Extension Manager". Its icon is a blue puzzle piece.


Click the "Browse" tab at the top, then search for "awesome tiles". Click the "Install" button to install it. Here you can see mine is already "Installed":


enter image description here


Click the "Installed" tab at the top, ensure the slider shows "Awesome Tiles" as activated (click the slider to activate/deactivate it), then click the gear icon to modify its settings:


enter image description here


Here are the default settings and shortcut keys it uses:


enter image description here


As you can see, it uses the Super (Windows) key + the keypad keys. A lot of smaller laptops and keyboards, however, do not have the keypad on the right side of the keyboard, so I recommend you use the Alt + Windows + Letters shortcuts which I've used in "Put Windows" before. Also, I really hate the gaps all around the windows (like a lot--so much so that I woulnd't recommend this tool at all if I couldn't remove them), so I recommend you remove the gaps by changing "Gap Between Window and Workspace" to 0, and disabling "Gaps Between Windows".


But, before we can add all of the shortcuts I like, we have to disable the default Ubuntu Alt + Windows + S "screen reader on or off" shortcut, which interferes. Go to your Ubuntu Settings --> Keyboard --> click "View and Customize Shortcuts" --> type in "alt+super+s", as shown here:


enter image description here


Click the "Turn screen reader on or off" shortcut you can see which is currently assigned to Alt+Super+S, and press Backspace to disable the shortcut --> click the "Set" button. You can now see it is "Disabled". Perfect:


enter image description here


Now go ahead and change your "Awesome Tiles" keyboard shortcuts to be as follows. Remember that the Super key is the Windows key on a PC. Here are my new settings. I have highlighted all of the ones I just changed:


enter image description here


Update: I just changed this too: I changed 0.35 -> 0.33, and I added 0.25:

enter image description here


If you ever want to reset all of the settings to their defaults, see my answer here: How do I reset a Gnome Extension's settings to default? Ex: for "Awesome Tiles" in Ubuntu 22.04?.


Two other settings you may want to mess with are the "Center Tiling Steps" and "Side Tiling Steps". If you press the same shortcut repeatedly, it cycles through those multiple size settings as set there. Those are values from 0 to 1, where 0 represents 0% of the full size for that position, and 1 represents the full size for that position, So, press the same shortcut repeatedly to cycle through 3 (as currently set) different sizes for each one, sized according to those settings.


To get the most consistent results, I like to tile the window to center first. So, if I wanted to resize and snap the window to the top-left corner, I would press first Alt + Windows + S to center the window, and then I'd press Alt + Windows + Q to resize and snap it to the top-left. Centering between each move ensures it's always the correct size for that new position.


That's it! This is an excellent extension to use keyboard shortcuts to resize and snap your windows to edges and corners!


Extension 2: WinTile (allows you to drag with the mouse your windows to resize and snap them to left, right, or corners)


Tested in Ubuntu 22.04 with both the X11 and Wayland window manager servers, and in Ubuntu 18.04 and 20.04 with X11.


Note: following my instructions below to install WinTile Reloaded in Ubuntu 18.04 also fixes the animation flickering problem you'll see with regular WinTile in 18.04 otherwise when snapping a window to an edge or corner.


If in a hurry, just jump straight down to the "Install WinTile" section below. It's just a few short commands and steps.


The WinTile tool works phenomenally-well in Ubuntu 22.04, with both the X and Wayland window manager servers, and easily snaps windows into corners or edges. You have to follow my install instructions below, however, as it can't be installed from the browser (yet).


It takes some getting used-to compared to the tools I've been using for the past 8 years: CompizConfig in Unity in Ubuntu 14.04 and 16.04 and the "Put Windows" tool in GNOME in Ubuntu 18.04 and 20.04, but overall it gives a more-natural experience if you're using a mouse. Just drag the window towards the monitor edge or towards the corner and it automatically resizes and snaps accordingly! Here is an animated gif from the GitHub page: https://github.com/Fmstrat/wintile:


enter image description here


WinTile er, uh, problems


The WinTile tool hasn't been maintained in about a year so it's missing a few small PRs to bring it up-to-date. Therefore, it cannot be installed from the Gnome extensions store just quite yet. The biggest change it is missing is this tiny PR, which simply adds Gnome 41 and 42 to the metadata.json file to indicate it is compatible with these versions of Gnome as well: https://github.com/Fmstrat/wintile/pull/82/files


Note that the "About" section of Ubuntu 22.04's Settings shows me that it uses GNOME 42.5:


enter image description here


Here is the main WinTile repo: https://github.com/Fmstrat/wintile


Until it merges its 8 open PRs, and/or until someone else forks it and takes it over, we will use this temporary fork (which has disabled "Issues" in GitHub because they don't want to maintain it), but which conveniently has merged the open PRs: https://github.com/Captn138/wintile-reloaded


References I used to figure out the above and the following:



  1. https://github.com/Fmstrat/wintile/issues/81

  2. https://github.com/Fmstrat/wintile/issues/91

  3. https://github.com/Fmstrat/wintile/pull/82

    1. ***** https://github.com/Fmstrat/wintile/pull/82#issuecomment-1236829893

    2. My comment: https://github.com/Fmstrat/wintile/pull/82#issuecomment-1358954979




Install WinTile


Like I said, for now we will use https://github.com/Captn138/wintile-reloaded. Here's how to install it:


Open a terminal with Ctrl + Alt + T and run the following commands, one-at-a-time:


cd ~/.local/share/gnome-shell/extensions
# clone the tool
git clone https://github.com/Captn138/wintile-reloaded.git
# rename it
mv wintile-reloaded [email protected]

# log out of Ubuntu
gnome-session-quit

Now manually log back into Ubuntu, then open your Gnome Extension web-page as a portal into your locally-running Gnome extensions server: https://extensions.gnome.org/local/


You'll now see "WinTile RELOADED" as an option!:


enter image description here


To activate it, you can either click the toggle button from "OFF" to "ON" in that extension webpage (you must do it in this way in Ubuntu 18.04, and you can do it this way in Ubuntu 20.04 or 22.04), or run this at the terminal:


# enable it as a Gnome Extension (this cmd works in Ubuntu 20.04 and 22.04,
# but not in 18.04; for 18.04 you must manually click to enable the
# extension, as described just above)
gnome-extensions enable [email protected]

If you run the terminal command, you'll see the toggle update live in the browser window.


That's it! Drag windows to the corners of your monitor to your heart's content.


Configuration options


If you click the little tool icon in the browser you can change some settings if you like. Here are the possible settings to tweak. I decreased my "Delay in ms before preview displays" setting from the default 500ms to 100ms to make it much snappier.


enter image description here


Overall, not quite as versatile as "Put Windows" or "Awesome Tiles", but WinTile works great in Ubuntu 22.04, with both Wayland and X window servers, and it's more-intuitive for Windows users and those who like to use trackpads or mice ?.


Graphics driver problems in Ubuntu 22.04?


This is kind of related if you just installed Ubuntu 22.04.


If you find your new 22.04 computer having graphics driver problems or freezing, and you have an NVIDIA graphics card, see my detailed answer here to update your graphics drivers. See: (Recommended) Option 2: download and install the driver straight from NVIDIA.


Related issues:



  1. https://github.com/Fmstrat/wintile/issues/91


[#101] Saturday, October 1, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anxietunnel

Total Points: 66
Total Questions: 120
Total Answers: 115

Location: Norway
Member since Sat, Mar 4, 2023
1 Year ago
anxietunnel questions
;