Linux Format

Ultralight Mint

Embrace minimality and learn some keyboard gymnastics with the featherwei­ght Sway desktop.

-

WINDOW TILING IS AN ART “To make the most of window tiling, much like an Etch A Sketch you’ll want to use a combinatio­n of horizontal and vertical arrangemen­ts.”

One of our new favourite Ubuntu-derivative­s is Regolith Linux. It’s fairly unique in its choice of the ultra-light i3 tiling window manager. Tiling window managers take some getting used to, and also a whole lot of configurat­ion, but Regolith ships with remarkably sane defaults and easy to learn keyboard shortcuts (i3 is very much keyboarddr­iven, but converts say they never looked back). Also, it still has all of the GNOME infrastruc­ture and applicatio­ns for managing sessions and settings, so all of your system administra­tion can be carried out with familiar GUI apps. It’s well-known that we’re big fans of Pop!_OS too, and in particular its COSMIC (Computer Operating System Main Interface Components) desktop. This features a tiling mode that, while not having the diminutive resource footprint of i3, offers users a gentle introducti­on to the joy and efficiency of keyboard shortcuts and mouse gestures in harmony.

There’s no reason we shouldn’t have these sorts of things in Mint too; the i3 window manager is in the Ubuntu repositori­es. But we’re going to try something else. Sway is a lightweigh­t window manager inspired heavily by i3, except that it is for Wayland. If you are familiar with i3 you will quickly get the hang of Sway; most of the default keys are the same, and you can even use your own i3status scripts. In fact, you should be able to use your i3config file without modificati­ons. Sway is in the Ubuntu repos, but it’s an old version from January 2020. It would take some work of the compiling variety to get the latest version working, so let’s just install the repo version to dip our toes in:

$ sudo apt install sway

As before, the login screen should now have a Sway session. Dive into it and you should see the rather fetching Sway logo and top bar. Try anything with the mouse (besides moving the pointer) and you’ll realise that you’re not in Cinnamon any more – nothing reacts to being clicked, double-clicked, dragged or any such thing. Sway is all about keyboard commands: try pressing Super (the brand-independen­t name for the Windows key) and Enter. A terminal should spring into life, so now you can at least practise your Bash scripting for a while.

Now try pressing Super+2; the terminal will disappear, but not really – cast your eye to the top-left and you’ll see we’ve just moved to a new virtual desktop. If you try to open another one with Super+3, you’ll see that this doesn’t happen. We didn’t need a third desktop because we hadn’t opened anything on our second, so Sway quietly renamed the previous workspace to 3.

Go back to workspace 1 and hit Super+Enter to open another terminal. Now you can see what tiling window managers are all about. The first terminal, that was occupying the whole desktop, obsequious­ly squishes over to the left, making room for a new terminal to the right. If you like, you can start any program you want from either of these terminals (notice the focus follows the mouse so you don’t need to click in either one).

But Sway also has its own applicatio­n launcher, after a fashion. Hit Super+D and you’ll see some commands in lexicograp­hical order (some beginning with numbers, and several beginning with the letter A, probably). Start typing the first few characters of firefox and you’ll see this list get rapidly smaller. Press Enter when firefox is highlighte­d in blue to start it.

If you already had a couple of windows open, things by now will probably be getting a little cramped. You could close one of them (either with a Ctrl+D or traditiona­lly with the Close button). But now is also a good time to introduce window resizing. With at least two windows open, hit Super+R to enter resize mode. You’ll see this indicated in the top left of the status bar. Now you can use the H and L keys (like Vi) to make the active window (and remember you can change this by

hovering the mouse over a new window) wider or narrower. That covers one dimension. Press Esc to exit resize mode and the hit Super+E while focused on the leftmost window. Bam! Vertical windows. Be careful of case sensitivit­y here, because Super+Shift+E (often abbreviate­d to Super+E) is the shortcut to exit Sway.

In order to make the most of window tiling, much like an Etch A Sketch you’ll want to get the hang of using a combinatio­n of horizontal and vertical arrangemen­ts. This seems straightfo­rward at first, but there are a few subtleties that are best experience­d for yourself. Before, the Super+E shortcut operated on several windows at once and tiled them uniformly. They were grouped together along a common dimension. But if you hit Super+V on one of them, then hit Super+Enter to open another terminal (or open any other applicatio­n for that matter), it will open in the other orientatio­n. In this way you’ll see that Super+E and Super+V act as orientatio­n triggers, and you’ll notice that the former highlights the right edge of window, and the latter highlights the lower edge, giving a hint as to how the next window will spawn.

Sway’s default configurat­ion file can be found at /etc/sway/config, but rather than edit this directly, copy it to ~/.config/sway/config to make personal changes. For example, the line:

output * bg /usr/share/…

sets the background on all displays. You can change this, or indeed set a custom background for each display, by modifying this. The output directive actually controls all sorts of things fundamenta­lly related to the display. For example, if you’re running Sway on a virtual machine, putting the final touches to the overdue cover feature, you’ll probably need to add a line of the form:

output Virtual_1 resolution 1280x720

in order to make your screen grabs have the correct aspect ratio. You can get a list of display names and modes by running:

$ swaymsg -t get_outputs

Sway and i3 are famed for their low memory footprints. But in order to keep these low, and maintain a minimal desktop aesthetic, one has to use lighter applicatio­ns too. This isn’t quite the place to show how much stuff you can run from the terminal, but you should check out the nnn file manager, the w3m web browser, mpv the video player and the ncmpcpp frontend to the mpd music player. What we will demonstrat­e is how to swap the default Gnome terminal for something a little lighter.

You might have noticed when we installed Sway that it pulled in a package called Suckless Tools. Suckless (https://suckless.org) is as much a state of mind as a software suite, and encompasse­s a range of ultra lowresourc­e utilities and daemons. These include the dwm window manager, the suckless terminal and a few more. We covered them back in LXF254 and they’re actually of limited use for us here because most of them don’t cater to Wayland.

These get installed primarily for the sake of the dmenu program which (through Xwayland) provides the handy Super+D launcher we met earlier.

Have fun tweaking!

 ??  ?? The rxvt-unicode terminal isn’t that pretty in its default state, but we’re sure you can make it so.
The rxvt-unicode terminal isn’t that pretty in its default state, but we’re sure you can make it so.
 ??  ?? You’ll need to use shutdown from the login screen with Sway; a nimble Super+Shift+E will get you there.
You’ll need to use shutdown from the login screen with Sway; a nimble Super+Shift+E will get you there.
 ??  ??

Newspapers in English

Newspapers from Australia