Advanced Window Management in Linux

Last week I wrote about an easy method for controlling windows in Linux. I ended the article by saying “perhaps there’s a way to automate this…” and it turns out, yes, there are SO MANY ways. Down the rabbit hole I go…

This week I’ve been exploring alternative window managers. Window management is a topic I’ve never really investigated before. On Mac, there are plenty of apps that will help you layout your windows more efficiently, but I never fell in love with any of them. I mostly managed my windows manually, with my mouse. After trying out a couple of true window managers, I can hardly believe what a big difference they make.

What are window managers? #

On Mac, most window managers are apps that try to layout your apps automatically, in preset grids, or they make it easier for you to manually grid your windows. There’s no doubt they make things look prettier and more organized, but I found that they didn’t really help with much else.

On Linux, window managers are much different than on Mac. They change everything about how you work. Window managers aren’t simply apps that sit on your desktop and tweak things for you, they are your desktop. Without a window manager, you have no desktop. Window managers control the menus you see, the notifications you see, the mouse, the UI. As such, they have a profound effect on the experience of using your computer.

Pop!_OS comes with a tiling window manager that you can turn on and off, which is handy, and a good entry point for window managers. I like it well enough, but it’s simple enough that it ended up as more of a crutch for me than a help. I ended up stacking way too many windows, which led to searching through stacks of windows with the mouse. Not ideal. So it was time for a change.

Why is window management important? #

At any given moment I have anywhere from 12-24 windows open on my work machine. I spend a lot of time swapping between projects and between applications, and the faster and more effortless you can make those transitions, the better.

That is the primary goal of a window manager: to make managing your windows effortless. If a window manager doesn’t do that, then maybe it’s not the one for you.

A good window manager not only lays out your applications for you, it also allows you to effortlessly move them, resize them, swap them, open and close them, etc. It also allows you to save your favorite configurations so you can make that decision once, and never think about it again. You can have distinctly different layouts for different workflows, build that into your configuration, and never think about it again.

Diving In #

From my tiny bit of research I found two window managers that seem to be best in their class: awesome and Qtile. I started with Qtile, but I had some issues integrating it into Pop!_OS, so I installed awesome instead (note: this video by DistroTube was invaluable). It took some time working on my configuration, but it was time well spent.

Awesome comes with a bunch of default layouts, along with many fairly intuitive keyboard shortcuts. One of the best shortcuts is super+s, which gives you a full list of keyboard shortcuts, including any you add yourself. If you ever forget a keyboard shortcut, you can find it easily with this tool.

Initial Impressions #

Awesome is very impressive so far. I’ve only been using it for a few days, but I already really like it. Even though it still feels a bit foreign and I’m having to retrain my muscle memory, I think it’s already made me more productive.

One thing I didn’t realize (although in hindsight it seems obvious) is that awesome comes with 16 built-in layouts. You can change layouts with the press of a button, and awesome automatically moves your apps into the optimum configuration for the new layout. They’re all different, and they’re all useful for different types of work.

One of my favorite options is the magnifier, which is now the default layout for several of my workspaces. The magnifier gives you one focused app in the middle of your screen, and all other apps in this workspace tile around it. My screen is big enough that I rarely want full-screen apps, this gives me a fullscreen-like experience while still allowing me to see everything I have going on in this space. I like it a lot.

An example of the magnifier layout in awesomeWM.
The magnifier layout in action, with three apps open.

You can then swap between these apps with keyboard shortcuts, or by clicking on them. Whichever app you focus on becomes the “active” app in the center of the screen. I discovered while writing this article that it’s not great for drag-and-drop, but I love using it when I’m researching and taking notes. Very handy to have fullscreen apps that you can peek behind, so to speak.

Will I stick with it? #

Definitely, at least for the foreseeable future. Even in less than a week, I’m already recognizing the many benefits to using a proper window manager, and I don’t see myself abandoning it any time soon.

The two big questions in my mind have to do with reliability and aesthetics. awesome is not concerned about aesthetics out of the box, and I’m definitely going to want to fix that eventually. I also have no idea how reliable it is, whether things will randomly break or not. I hope not, but only time will tell.

App switching? #

I started this article talking about app switching. Awesome has such good keyboard shortcuts built-in that I hardly even need this anymore! But here’s one tip that I have found handy: I find myself frequently needing a single new web browser window on my current workspace. I already have my web browser (Brave) open elsewhere, but I need a new window to use temporarily. This is extremely easy to set up in the awesome config:

-- if you want to use a hyper key, like I do
-- add this variable after your "modkey" variable
local hyperkey = {modkey, "Shift", "Ctrl", "Mod1"}

-- place this inside the keybindings section of your config
awful.key(hyperkey, "b",
function (c)
awful.spawn.with_shell("brave-browser --new-window")
end ,
{description = "Open new Brave window"}),

That allows me to open a new Brave window any time I want by pressing hyper+b. Extremely useful. And you can use this same method to create keyboard shortcuts for any terminal command, which means you can bind basically anything to a keyboard shortcut. The opportunities are endless.

← Home

  • Publishes new article about awesomeWM