WINDOW MANAGER DESKTOP GUIDE

INDEX

Introduction

In this article we'll explore the fascinating world of X11 window managers. Now, you may think: "X11? Window managers? What century do you think we live in?!? And to be sure, these applications do have a long and venerable history. But they are not quite as dead (or boring) as you may think. Besides inspiring numerous Wayland compositors, many of them are being actively developed in their own right, and you might be surprised at just how varied and fun X11 window managers can be! (see the Switch Desktop? section if you need help testing out the window managers in this article)

Disclaimer: The purpose of this article is not to provide a comprehensive guide to all X11 window managers, but simply to explore some of them. In order to avoid repetition, I also ignore or gloss over candidates that are similar to previous entries. Unfortunately this does mean that many good window managers do not get the attention that they deserve. But I hope the article might inspire you to explore and discover your own favorites, even if they aren't listed here. Of course, since this article is written by an oldschool human, and not a modern AI, I'm sure it includes ignorant or opinionated statements, and I apologize in advance if I step on some toes.

Stacking Window Managers - Middleweight

It wouldn't be right to call any standalone window manager "heavyweight", but there are some that do not exactly match the term "lightweight" either. (compared to really lightweight alternatives that is) What characterizes the "middleweighters", as we call them here, is that they are complex window managers that often present the user with a relatively rich GUI out of the box.* They are often a good place to start if you are migrating away from a big desktop environment. (generally, we're listing the candidates from heaviest to lightest)

Enlightenment - Eye Candy Contemplations

When one thinks of window managers, as opposed to modern desktop environments, the image of a ancient pixelated 256-color wireframes proactively tearing the screen spring readily to mind. And though that is true, with some modifications, for the most part, Enlightenment is a shining, animated and transparent exception. It is old though. The project sprang to life in 1997, along side other classics such as, Window Maker, IceWM and Blackbox. (the precursor to Fluxbox/Openbox)

From the onset, Enlightenment has focused on providing stunning eye-candy as efficiently as possible. The window manager stabilized into version 0.16 (or E16), as the development branch (E17) worked towards a split between the Enlightenment Foundation Libraries (EFL) and the desktop environment built on top of it. E17 became something of a "Duke Nukem Forever" in Linux lore, as development took 12 years before it finally hit the 1.0 milestone in 2012. Since then, the Enlightenment project has continued to focus on developing its gorgeous, but oh so flickery, desktop. Meanwhile, the old E16 window manager is still being maintained by the community, and it is this version of Enlightenment that we want to focus on here.

To be fair, the eye-candy that E16 provides (eg. true transparency, window shadows, animations, movable pager thumbnails), while knocking off socks in 1997, is not going to impress anyone today. But it is nice. What really sets E16 apart though is how lightweight it is. It will eat up around 30-40 Mb of RAM, not much more then Window Maker or a heavily themed Fluxbox. Compared to what you get, the efficiency of E16 is uncanny! Even on a 32-bit lappy with 2 Gb of RAM, E16 will let you cruise along comfortably, providing animations with zero lag.*

You probably want to spend a few minutes tweaking the E16 visual effects, and other settings in the default menu. You can also edit the application menu ~/.e16/menus/user_apps.menu to suit your needs. (wallpapers go in ~/.e16/backgrounds) To edit hotkeys you can use the 3rd party tool e16keyedit. For example, one annoyance I have with E16 (besides generall pixel hunting) is that is doesn't provide any way to maximize a window to the left, or the right half side of the screen. Using e16keyedit you can define two "New Keybinding"'s, set "Modifier" to "MOD4" (the Windows Key), click "Change" and press the left arrow key, set "Action Used" to "Run command" and specify the "Command": exec maxleft (and do the same for the right arrow key - exec maxright) You can now write these functions as simple shell scripts:

$ cat ~/bin/maxleft
#!/bin/sh

xdotool getactivewindow windowsize 940 1040
xdotool getactivewindow windowmove 20 0
$
$ cat ~/bin/maxright
#!/bin/sh

xdotool getactivewindow windowsize 940 1040
xdotool getactivewindow windowmove 960 0
            

After a quick restart you can now maximize to the left or right half of the screen with Win + Left/Right. As you can see, we use the xdotool utility to resize and move the currently active window to fit half of a 1920x1080 screen. (we don't maximize it fully but leave a 20 px gap in strategic places) Of course, this is just a suggestion. The point is that you can easily add basic tiling and other features that E16 does not natively support.

Old Relics

As a window manager, the old Enlightenment project can still satisfy modern users. Other aspects of the old project though may not impress that much, but let's review it anyway for completeness. The themes you get out of the box for instance, are limited. You can download the e16-themes from SourceForge, which not only contains E16 themes, but also themes for related utilities (eg. Eterm). Beware though that this is something of a mixed bag; It contains hundreds of themes, and though the latest release was as recent as 2023, there is quite a bit of legacy... junk in there. (I liked the 23ozGlass, Black_E, OrangeJuice, R-9X and Unity themes myself)

Speaking of legacy junk, you'll note that the E16 menu refers to "Epplets". Again, you can get the e16-epplets from SourceForge. (click "Maintenance" -> "Regenerate menus" after installing them) The Enlightenment "epplets" seems to have takes some inspiration from Window Maker dockapps, they provide a small set of utilities that can display the time, network load, battery status etc, that you can stick to the desktop. (press the Alt key to drag them around) Although the latest maintenance release of this package is from 2022, these utilities are fairly old and broken. They're not worth it in my opinion.

The Enlightenment project has also spawned a couple of terminal emulators. The recent one, Terminology, is of course as modern and slick as a terminals get. The old E16 terminal, Eterm is another story. It's an rxvt hack that allows more theming and fake transparency. This is not what you want if you're looking for a slick and modern desktop! (though it can be fun to play with if you're looking for something retrotastic) If you want to try out one of the Eterm themes from the e16-themes package, move the Eterm directory to ~/.Eterm/themes/Eterm. Fonts are somewhat problematic. You can find a font you prefer with xfontsel and try something like Eterm -F '-misc-ocr a-medium-r-normal--17-120-100-100-c-0-iso10646-1'.

Honorable mention: picom

Although Enlightenment is the only window manager in this article that provides native compositing, you can enable such features in other window managers, thanks to the standalone compositor picom. (a fork of compton, a fork of xcompmgr) Beyond drop shadows, true transparency and other eye candy, it also reduces screen tearing. Best of all, it is lightweight. To use it, you can simply add a line to your window manager or X startup configuration (eg. ~/.xinitrc), such as: picom -cfF -o 0.38 -O 200 -I 200 -t 0 -l 0 -r 3 -D2 -m 0.88 -i 0.80 &, or you can write a more elaborate configuration in ~/.config/picom.conf. (if you need application specific settings for instance)

FVWM - Desktop Construction Kit

FVWM (the F Virtual Window Manager),* is an old project from way back in 1993, it's based on the oldest window manager still in existence - twm (the T Window Manager)* twm is an unusually configurable window manager. FVWM is twm on steroids. In fact, FVWM is less of a "window manager" then it is a construction kit for window managers. It is enough to mention that AfterStep, MLVWM and NsCDE (a NeXTSTEP, Macintosh and CDE clone) are all based on FVWM, to give you some inkling of what you can do with it.

Tweaking Ancient FVWM

Now, having that said, it is not easy to construct such a desktop with FVWM. Just, somewhat, more so then building it from scratch in C. Of course, you may find that you enjoy the default FVWM configuration, and just need to tweak one or two settings. To illustrate the point, lets tweak the default OpenBSD desktop a bit; It uses an archaic version of FVWM2* install that appeals to the minimalistic strata of weirdos, such as yours truly. But I have some gripes with the stock settings. For one, The only quick launch application in the menu is "XTerm", we clearly need to add a few more, a web browser at least. Secondly, FVWM has the ability to use two dimensions of virtual workspaces, but the default only gives me a measly pager with nine!

We begin by copying /usr/X11R6/lib/X11/fvwm/.fvwmrc* to $HOME, and giving it write permissions. Even this bare bones configuration file consists of over 500 lines, so you'll likely need some time wrapping your head around it. (not to mention the ~50 page manual) But after a bit of head scratching, I made the following changes; After the line that specifies the XTerm quick launch in the menu, we add a line for our web browser:

+            "XTerm%mini.xterm.xpm%"          Exec exec xterm
+            "Netscape%mini.netscape.xpm%"    Exec exec firefox
            

Finally, towards the end, we add our virtual workspace hotkeys:

############################################################
# Virtual Workspace Hotkeys

Key 1   A       M       GotoPage        0 0
Key 2   A       M       GotoPage        0 1
Key 3   A       M       GotoPage        0 2
Key 4   A       M       GotoPage        1 0
Key 5   A       M       GotoPage        1 1
Key 6   A       M       GotoPage        1 2
Key 7   A       M       GotoPage        2 0
Key 8   A       M       GotoPage        2 1
Key 9   A       M       GotoPage        2 2

Key 1   A       MS      MoveToPage      0 0
Key 2   A       MS      MoveToPage      0 1
Key 3   A       MS      MoveToPage      0 2
Key 4   A       MS      MoveToPage      1 0
Key 5   A       MS      MoveToPage      1 1
Key 6   A       MS      MoveToPage      1 2
Key 7   A       MS      MoveToPage      2 0
Key 8   A       MS      MoveToPage      2 1
Key 9   A       MS      MoveToPage      2 2

Key 1   A       4       Desk            0 0
Key 2   A       4       Desk            0 1
Key 3   A       4       Desk            0 2
Key 4   A       4       Desk            0 3
Key 5   A       4       Desk            0 4
Key 6   A       4       Desk            0 5
Key 7   A       4       Desk            0 6
Key 8   A       4       Desk            0 7
Key 9   A       4       Desk            0 8

Key 1   A       4S      MoveToDesk      0 0
Key 2   A       4S      MoveToDesk      0 1
Key 3   A       4S      MoveToDesk      0 2
Key 4   A       4S      MoveToDesk      0 3
Key 5   A       4S      MoveToDesk      0 4
Key 6   A       4S      MoveToDesk      0 5
Key 7   A       4S      MoveToDesk      0 6
Key 8   A       4S      MoveToDesk      0 7
Key 9   A       4S      MoveToDesk      0 8
            

We can now jump around the 9 "Page" workspaces with Alt + n (where n is a number from 1-9) and navigate among the 9 "Desk" workspaces (which each has 9 "Pages") with Win + n. Ah, Perfection!

Now, you might be thinking, "I beg to differ! This is a foul setup and a ton of work - You could not possibly do a worse job of promoting FVWM!" And you know what, you're right! Let's give this another try shall we?

Tweaking Modern FVWM

We'll start by installing the latest version of FVWM3. Right out of the box, you'll note that this desktop is much more slick. But we can expand on these foundations. We can start by navigating to box-look.org and install the Fvwm-Kise theme. Extract the theme to ~/.fvwm, and restart the window manager.

It takes a while to load, and the lappy is making some angry fan noises now. But eventually we're greeted with an exciting and busy desktop! Lots of stuff to explore here! Now granted, the theme does not work perfectly out of the box - FVWM themes never do. We'll need to spend some time tweaking the fonts to get them right, and the menu is not transparent. Hm, maybe we need to adapt the theme to use transset-df, instead of "xtrans", we'll just skim the er... 400 files in the theme. Well, the manual should help, or manuals I should say, there are 27 of them now. Why is this so slow? Let's check the memory usage... oh my! Er... you know what, maybe the old OpenBSD defaults weren't so bad after all.

Oh dear, this wasn't a very good review of FVWM was it? But, perhaps, an honest one? Don't get me wrong; You can obviously do a better job of making a nice desktop with FVWM then my sloppy attempt here, and if you are a tinkerer, you may just have found the gateway to heaven. Personally though, I find that FVWM is too complicated for its own good, but it would be cool to see more projects like NsCDE or MLVWM, that use FVWM as a foundation to create truly unique desktops.

IceWM - A Modern Windows 95!

IceWM is another classic window manager choice. Released in 1997 it closely follows the most successful GUI of the time, Windows 95. Unless you are born in this millennium (and unless you have a high def resolution),* you shouldn't have any problems navigating this window manager. It is easy to use, and it is easy to modify; Just copy the standard configuration files to ~/.config/icewm (eg. cp -r /usr/share/icewm ~/.config) and edit the text files to your needs. Don't let the word "text" scare you, it is a breeze to edit these files compared to some other window managers we won't mention.

But you might be thinking; "Why would I want to use a 30 year old desktop?" You wouldn't. Here's the thing; IceWM is not a 30 year old desktop, it looks like a 30 year old desktop. There is a difference. As of this writing, the latest version of IceWM was released 16 days ago. This isn't just a bugfix either, one of the latest features that I really appreciated was the ability to tab arbitrary windows together, an idea the developers nicked from Haiku. (hold down Shift and middle-click to drag one titlebar on top of another)

Ok, still, why would you want a desktop that looks 30 years old? Well, you might if you're in a retro mood. And besides, many people find the Windows 95 GUI's very pleasant and productive. If you feel that way, why shouldn't you be allowed to use it? In OpenSource systems you do not have to use the latest brain child from corporate headquarters; choose your own style.

Adding Desktop Icons

One Windows 95 feature missing from IceWM though are desktop icons. You can add that if you want. One alternative is idesk. Copy the example configuration to your home directory after you've installed it, eg. cp /usr/share/idesk/dot.ideskrc ~/.ideskrc, then make a directory for your desktop icons; mkdir ~/.idesktop. If you run idesk now an xterm icon will pop up on your desktop. To create more icons, simply go to ~/.idesktop and edit the files to your needs. We could for instance copy the default.lnk to home.lnk and edit the contents like so:

table Icon
  Caption: Home
  Command: /usr/bin/thunar /home/myname
  Icon: /home/myname/.icons/folder.png
  Width: 64
  Height: 38
  X: 30
  Y: 130
end
            

This will use the Xfce file manager, thunar, to open up your home folder, and you'll need a folder.png icon in your ~/.icons directory. (you can just Google for such icons) You can adjust the theme and behavior of idesk in ~/.ideskrc. This is of course a very minimal way to get desktop icons, and it's a bit fiddley to edit text files whenever you wish to add an icon. An more interactive alternative would be rox-filer. Run rox -S --bottom="" to get a ROX desktop, with icons and wallpaper, but not a panel, witch IceWM already provides. (check out the ROX desktop link for more information on how to use this) To permanently add one of these programs to IceWM, just add it to ~/.config/icewm/startup.

Honorable mention: JWM

Like IceWM, Joe's Window Manager (JWM), also follow the Windows 95 GUI with start menu and panel. But it is significantly simpler, both on resources and to configure. JWM may arguably be the lightest window manager available that is still easy on the novice. Which is why, I suppose, Puppy Linux uses it to power their desktop.

Window Maker - Agile NeXTSTEP Zombie

Window Maker was a "new" take on making an OpenSource alternative to the NeXTSTEP desktop (the company that Stieve Jobs created before he went back to Apple), as opposed to the "old" take, AfterStep, the FVWM hack. At the time, many honestly believed that these efforts would usher in the year of the Linux desktop. So much for techy soothsayers.

Of course, this all happened in the distant past, prior to the advent of smart phones and shortly after the invention of the mouse wheel. What relevance does this history have today? You'd be surprised, but Window Maker, or wmaker for short, is still being actively developed, the latest release being from 2023. One nifty feature that was added in recent years is "snapping", when you drag a window to a side of the screen it maximizes to that area. Just as modern desktop environments do.

When you start up Window Maker you'll notice the iconic squares along the bottom and top right corners of the screen. The bottom area is your basic "window panel" where minimized applications go. (these are workspace specific) The top right area is intended as your application "dock", containing the programs and dockapps you'd like to see on every workspace. You'll also notice that the application menu is "sticky" by default. It does not disappear unless you right click.

Although this interface will be unusual for a modern user, you'll quickly get the hang of it. Overall, Window Maker feels very solid. You can configure everything using the configuration manager, including the ability to edit the menu by dragging stuff about. It does not have an overwhelming amount of features, but those it does have, seem very polished. Of course, it certainly looks retro, but you'll find that Window Maker is as snappy as it is stable.

Cursed Heritage

You mentioned "dockapps"? Ah yes, since the program launchers in Window Maker are fairly large squares, it allows for quite functional mini applications that run entirely within this small area. In the past, such dockapps were quite popular. Not only where there eventually hundreds of them, but even unrelated window managers started to support them. Today however, such dockapps are becoming increasingly obscure and unmaintained, although you'll likely find a few good ones in the repo.

More problematic perhaps is GNUstep, yet another GNU project in a perpetual alpha state. Technically, Window Maker is just the window manager for the GNUstep desktop environment, although the "desktop" part of it has yet to be released. GNUstep still exists but it's dormant. My advice is to use applications from other desktop environments in Window Maker.

Dishonorable mention: AfterStep

We have already mentioned AfterStep in passing. It was the first OpenSource attempt at making a NeXTSTEP-like clone. In years past it gained a fan following, and contributed many dockapps and other utilities, such as the asfiles file manager and the aterm terminal emulator.

I have been aware of AfterStep for quite some time, and I have made serious attempts at using it in the past. It's hard to quantify exactly why I dislike it so much, it isn't just the bloated nature of it, or the messy interface with fake transparency and tacky 3D colored text, or the thoroughly unintuitive mechanics. It's like trying to describe why Marmite tastes so foul, it just does. Some people love Marmite. Some love AfterStep. More power to them! (the sentiment is mute though as AfterStep hasn't seen any development the last 12 years)

Questionable mention: MLVWM

In the context of retro Apple Desktops, we could mention MLVWM (the Macintosh-like Virtual Window Manager). Don't get your hopes up to quickly though! It's a bit of a hassle to set up (you also need mlvwmrc), and after you successfully boot it up, what you are greeted with is a thin Macintosh-like skeleton, with many empty placeholders for Macintosh-like functionality. This is intentional. MLVWM is not intended as a finished product that you can just pick up and use right of the bat. Rather, it gives you a starting point if you wish to build a retro Macintosh-like interface. But hey, if that's your think, have at it!

Stacking Window Managers - Lightweight

Lightweight window managers are minimalistic, perhaps they will give you a menu, maybe even the most basic of panels, but that's it. These window managers appeal to two sets of users; the minimalists and the tinkerers. Some people actually prefer the minimalistic defaults that these window managers provide, and tinkerers will often find it easier to build up the perfect desktop from a small foundation, rather then trying plastic surgery on a behemoth.

Fluxbox/Openbox - A Window Manager Foundation

Blackbox is one of the classic Linux window managers from the late 90's, it's still around, but most of the attention has moved on to the newer Fluxbox and Openbox forks. The difference between these two is that Fluxbox is intended as a continuation of Blackbox, and it emphasizes user control. Openbox is a rewrite in C, using XML configuration files (as opposed to C++ and plain text files), it emphasizes efficiency. Nevertheless, these two projects are very similar and very lean. At the risk of oversimplifying, Openbox is often prefered by developers who needs a solid foundation to power their product, while Fluxbox is often prefered by hackers who want to build up their own desktop. In this article we'll be focusing on Fluxbox.

The default look of this window manager is not especially pretty, and the default menu includes many irrelevant relics from the past, but few of the modern applications you need. Don't let it scare you, it's easy to remedy! We can start by hunting for a better theme on box-look.org. Extract the theme you like to ~/.fluxbox/styles, and you can select it in the menu: "Fluxbox menu" -> "User styles". The fonts may not work perfectly for your resolution, but you can overwrite the theme settings in ~/.fluxbox/overlay. To set a wallpaper, you can use feh --bg-scale /path/to/pic.png, for example, and add this command to ~/.fluxbox/startup. If you want transparency, you can also add picom & to the startup file, and adjust transparency settings in: "Fluxbox menu" -> "Configure" -> "Transparency".

What about the menu? There are a few auto generators available, such as MenuMaker. (which can generate menus for other WM's as well) Personally though, I find it less of a hassle to just edit the menu by hand. You can start by opening ~/.fluxbox/menu in your favorite editor, and delete virtually the whole kit and caboodle. Then carefully add the entries you need, to give an example:

...
    [exec] (Terminal)  {alacritty}   <~/.icons/alacritty.png>
    [exec] (Browser)   {chrome}      <~/.icons/chrome.png>
    [exec] (Run)       {fbrun}
[submenu] (Network)
    [exec] (Email)     {thunderbird} <~/.icons/thunderbird.png>
    ...
            

The syntax is pretty easy to understand, Fluxbox commands (like "exec") are in square brackets, the name tag in parenthesis, the command to run in curly brackets, and optionally, the icon between less-then/greater-then signs. You can edit ~/.fluxbox/init, or use "Fluxbox menu" -> "Configure", to adjust the window managers behavior to your liking. (Fluxbox has also nicked the Haiku window tabbing concept btw, hold Ctrl and drag the titlebars together or apart) You might also want to edit the keybindings in ~/.fluxbox/keys to your liking. I added the following lines for example, which lets me maximize a screen to the left/right half of the screen with Win + Left/Right:

Mod4 Left  :MacroCmd {ResizeTo 980 1080} {MoveTo  00 00}
Mod4 Right :MacroCmd {ResizeTo 980 1080} {MoveTo 980 00}
            

So far our modifications have been quite superficial, but with noticeable results! The fun with Fluxbox is hacking away at the easy to read config files. We can continue to modify the desktop quite a bit; What additional launchers, keybindings and tiling features do you need in your workflow? Don't like the Fluxbox panel and menu? Replace them! Go Bananas!

Honorable mention: PekWM

PekWM sprang into existence in 2009, and it is a relatively new entry into the window manager scene. It is not directly related to Fluxbox/Openbox, but I mention it here simply because it kinda feels like a "modern" take on them. Although PekWM is used by various projects, it is relatively obscure. Nevertheless I found it pleasant to use, perhaps you will too?

UDE - Get used to it!

UDE (aka uwm) is... confusing, in more ways then one. Let's start with the name; The Unix Desktop Environment (UDE) currently consists of only one program, the The Ultimate Window Manager (uwm).* Judging from their website, it seems that the project initially had the goal of creating a more elaborate "desktop environment", but uwm was all she wrote, so in practice UDE and uwm refer to the same thing.

The Unix Desktop Environment you say? I see here on Wikipedia that "uwm", from 1985, "was the only X11-compatible window manager as of X11R1!" Did Dennis Ritchie write... No, no, no and NO! Let's untangle some of this mess; UDE's uwm is not related to the old Ultrix Window Manager (uwm), neither is it directly related to Unix. It is a Linux project from the late 90's (that you can run on BSD). The reason the authors called it "The Unix Desktop Environment" seems to be that it is lightweight with no external dependencies. (wait.., is that what "The Unix philosophy" means?)* The fact that it doesn't come with a troff manpage, but a TeX PDF manual (that you should read!), betrays it's rather loosey-goosey ties to our illustrious Unix forefathers. The project seems to enjoy catchy slogans (UDE - Get used to it!) and Troll 2 naming conventions.

But lets talk about actually using uwm; now the confusion really kicks in! Visually uwm looks like a run-of-the-mill stacking window manager with a standard popup menu. To manage windows however you need to use your mouse buttons discreetly; Right-click to resize, Middle-click to move and Left-click to bring up a honeycomb menu with a skull. "A what now?" Yeah.., that's another distinct feature of uwm; Holding down the left mouse button on a window border will bring up six hexagon buttons that will allow you to do various operations, such as closing or minimizing the window. (minimized windows can be found in the workspace, middle-click, menu)

Why this novel design? It's actually quite smart, it allows you to do subtle operations that's not elegantly achieved in most other GUI's. To move a window and raise it for instance, middle-click, drag and left-click in one operation. To lower it, middle-click, drag and right-click. To launch three xterm's at once, right-click the root window to get the application menu and left-click three times on "xterm". No doubt this will feel alien at first, but given a little practice you might find that this is a very pleasant way to manage windows. (No need to pixel hunt the right corner, just click the button you want) I actually used UDE for a few years before Ratpoison finally won me over with it's warm user friendliness, and it likely softened the blow when I eventually migrated over to Plan 9. I'll admit I was initially attracted to UDE's weirdness, but after using it a while I found the mechanics very pleasant.

To customize uwm, copy the provided config file to ~/.ude (eg. cp -r /usr/share/uwm/config ~/.ude), and edit the files to your liking. Note a last confusion though; Since uwm has "no external dependencies", you'll find that it's much more quirky to extend then your average Fluxbox. I wanted to add some simple tiling hotkeys for instance, as we did with E16, but xdotool couldn't find the current window in uwm! After rethinking my approach I did come up with a workaround:

#!/bin/sh
# max - maximize a window
# usage:  max [orientation] [window]
# depend: plan9port

# set some defaults
screensize=${screensize:=0,0,1920,1080}    # hardware dependent!
orientation=f
if [ $# = 2 ]; then
    orientation=$1
    window=$2
elif [ $# = 1 ]; then
    orientation=$1
fi
if [ -z "$window" ]; then
    window=$(xprop | awk '/WM_CLASS/ { gsub(/\"/,""); gsub(/\,/,""); print $3 }')
fi

# redraw the screen (fullscreen, left, right, top, bottom)
case $orientation in
f) 9 xshove $window $(echo $screensize |\
   awk -F, '{ printf("%d,%d,%d,%d\n", $1, $2, $3-20, $4-20   ) }') ;;
l) 9 xshove $window $(echo $screensize |\
   awk -F, '{ printf("%d,%d,%d,%d\n", $1, $2, $3/2-20, $4-20 ) }') ;;
r) 9 xshove $window $(echo $screensize |\
   awk -F, '{ printf("%d,%d,%d,%d\n", $3/2, $2, $3-20, $4-20 ) }') ;;
t) 9 xshove $window $(echo $screensize |\
   awk -F, '{ printf("%d,%d,%d,%d\n", $1, $2, $3-20, $4/2-20 ) }') ;;
b) 9 xshove $window $(echo $screensize |\
   awk -F, '{ printf("%d,%d,%d,%d\n", $1, $4/2, $3-20, $4-20 ) }') ;;
*) echo Unknown orientation >&2 && exit 1 ;;
esac
            

In this example we are using xprop to interactively get a window name and xshove from plan9port (weird, I know), to redraw it. With this script you can type max l and click on a window to resize it to the left half of the screen, or type max r xterm to resize the xterm window to the right half of the screen, etc. You can of course add such commands to hotkeys, using sxhkdrc for instance:

$ cat ~/.sxhkdrc
mod4 + f
	max
mod4 + l
	max l
mod4 + r
	max r
mod4 + t
	max t
mod4 + b
	max b
mod4 + x
	xterm
$
$ grep sxhkd ~/.xinitrc
sxhkd -c ~/.sxhkdrc &
            

Besides the odd plan9port dependency, our solution here has a serious limitation; Since it redraws a window based on the application name, it will not work well if you use multiple windows of the same application. If you have three xterm's running for instance, it will redraw all three to the same place. xshove may not work well on multi-monitor setups either.

As for theming and eye-candy, trying to make uwm look slick will likely be an exercise in frustration. (the fact that wallpapers cannot be PNG's is somewhat indicative) I find it strangely enjoyable though to head in the opposite direction; It's easier to make it look weird and retrotastic. I also derive some small pleasure in seeing just how lightweight my unique looking desktop can be.*

UDE will not be everybody's cup of tea, but I think it will be interesting to spend a day or two playing with it. It makes you rethink GUI's, and there is just something endearing about its strangeness ;)

Honorable mention: rio

The Plan 9 window manager, rio bears some resemblance to uwm, in that it too utilises the three mouse buttons to do different window and menu handling. It also emphasizes mouse chording (pressing a combination of mouse buttons), although the purpose of this in Plan 9 is to manipulate and execute text, not subtle window management.

Plan 9 has influenced Linux in various ways. There are a number of rio look-alikes, that in turn have influenced and shared code with other window managers. (PekWM and cwm to name but two) And the code philosophy has strongly influenced the suckless community, creators of dwm and wmii (the i3 precursor). Yet, no desktop in Linux can really replicate the Plan 9 desktop experience, due to the fundamental differences in the operating system. All processes in Plan 9 have their own private view of the filesystem, which incidentally is communicated through a secure network protocol, for instance. This enables rio to run inside itself recursively, including instances across the network (aka 'remote desktop'), without additional code in the graphics stack. The take away point is that no operating system can "absorb" everything out there. There is value in diversity.

cwm - Zen

The Calm Window Manager, or cwm, is an OpenBSD rewrite of evilwm. (it's ported to Linux and the other BSD's as well) The goal of both of these window managers is minimalism. In addition to the user manual cwm(1), the window manager also comes with a configuration manual, cwmrc(5), that includes a good initial setup which will give you virtual workspaces and a bare bones application menu. You can spawn a new terminal with Ctrl + Alt + Return or launch an arbitrary program with Alt + ?. To manage windows hold down Alt and use different mouse actions; Left click to move and middle click to resize. You can change these defaults if you like, and you can set up all kinds of keybindings, including basic tiling operations.

You may wonder though why anyone would like such a minimalistic desktop? Well, you can of course expand on this foundation if you want to. Many like to add a panel and wallpaper to their cwm desktops or even write their own tools. I found TuM'Fatig's blog about writing a slick cwm panel using nothing but xterm quite inspiring, but you can use tint2, polybar or a plethora of other 3rd party panels.

Honorable mention: 2bwm

2bwm is a fairly recent window manager that follow the same minimalistic approach as evilwm/cwm. It's main claim to fame is a super simple, but oh so pretty, 2 layered neon-colored window border. This works very well with colorful terminals and other geeky eye-candy, making it a prime target for fancy screenshots. Of course, on the mechanical side of things, it can work well as a minimalistic window manager, and you can flesh it out with various add-ons. Unless you happen to be an OpenBSD nerd, you may wish to investigate 2bwm instead of cwm ;)

Tiling Window Managers - Manual

Tiling window managers were born a few years after Windows 95's GUI had successfully conquered the world, arguably, as a counter-revolution. The premise of these tilers is that it's a huge waste of time moving, resizing and generally pixel hunting windows. A modern window manager should be able to launch a window instantly at the press of a button and smartly put it where it ought to be. Or so the designers of tiling window managers argue. It is often stated that tiling window managers are efficient, and that could be true, especially if the applications you work with are also keyboard centric. For programmers, switching to a tiling window manager can be a game changer, but even for ordinary folk it can be surprisingly useful. Useful enough at least, that modern desktop environments have started to support snapping and other features nicked from these tilers.

Ratpoison - Get Focus or Die Tryin!

Ion and Ratpoison are two of the oldest tiling window managers that inspired the wave of new entries in this genre. Both are manual tiling window managers, yet the motivation behind them and their overall feel is very different. We can start with Ratpoison; As the name suggest, the ideology is actively mouse hostile. I don't know if Ratpoison is developed by evil cats or something, but the devs do seem to have a morbid love-hate fixation towards mice; Internally they distinguish between the standard dainty PC mice, and the large bulky gamer "rats", cordless "hamsters" and smartphone/table "roadkill". The Ratpoison developers loved splitting up their terminal windows with GNU screen (the precursor to tmux), and thought - why shouldn't I be able to manage my desktop in exactly the same way?

New users often suffer a mild form of panic attack when using Ratpoison for the first time. They are greeted with a totally blank screen, except for a thin white text box at the top right corner which says: "Welcome to Ratpoison! Hit `C-t ?` for help." Lingering just long enough for you to read it before it disappears into oblivion. That's as far as Ratpoison will go in the way of "user friendliness". Like pushing you out of the helicopter in the middle of Sahara, "just call me on the walkie-talkie if you need anything!" Yeah, thanks buddy! What walkie-talkie? Don't panic though, `C-t ?` is Emacs jargon, it means hit Ctrl + t, release the keys, then hit ?. This might feel strange if you aren't used to Emacs, but it's easy enough once you get used to it.

If you start up a few terminals with C-t c, (hit Ctrl + t, release, then hit c), it will seem like nothing happens after the first terminal started. This is because the next two terminals are drawn "on top" of each other, the older windows are there, you just can't see them. Hit C-t n to view them, or split the screen in two and view the terminals side-by-side: C-t S, then C-t Tab to move to the new frame. From here you can cycle through the available windows with C-t n.

If you're unfamiliar with tiling window managers, you might be wondering if all tilers are so brutally difficult. Trust me, they aren't. And we'll get to that in a minute. But for now, let's address the question of how you would use such a restrictive interface efficiently, and why you would want to. Tiling window managers are (potentially) efficient for two reasons; First, you don't need to waste time finding an application in some menu and resizing it to fit your fancy, just hit a key and go. Yet, with manual tilers like Ratpoison, it's easy to waste a lot of time managing a complicated grid. The trick of using manual tiling window managers effectively is to keep it simple. You don't need to see all your open windows, just the ones you need at the moment. On a day-to-day basis you hardly ever need anything more complicated then a side-by-side grid with two frames, and even that is a compromise, as far as Ratpoison is concerned; the optimal "grid" is fullscreen. This brings us to the second reason why tilers can be effective; Focus. It's a mistake to think that tiling window managers will somehow make your mess efficient, so that your desktop can go from a 20 window chaotic mess to an even more chaotic 80 window mess. What tilers can do is help you get more efficient by focusing on the applications you need, and give them undivided attention and screen space. In that respect, it's the limitations of Ratpoison that makes it interesting. Few window managers will provide more focus.

I actually used Ratpoison quite happily for many years, and I honestly think it could be healthy to spend a few days in this restrictive tiler to get some clarity of thought. Much in the same way that it can be healthy to spend some time in the TTY, using ed or taking cold showers. Yes, I know I'm a lunatic, but wiser people then me have noted the connection between privation and creation. The author Roald Dahl, for instance, would write his books with a pencil in a cold shed. Not because he was ascetic, but because it helped his creativity. If you want to try out Ratpoison seriously, you should probably spend some time setting up ~/.ratpoisonrc to your liking. Eg:*

# cosmetic settings
set fgcolor #75b5aa
set bgcolor black
set fwcolor #75b5aa
set bwcolor black
set border 1
startup_message off
banish

# custom keybindings
escape Super_L
unbind c
bind c exec alacritty
bind b exec chrome
bind d exec dmenu_run

# startup programs
exec xsetroot -cursor_name left_ptr
exec feh --bg-scale ~/Pictures/backgrounds/coolwallpaper.png 
exec rpws init 12 -k
            

Of course, this is just an example. The most important changes here are the escape Super_L line, which changes the escape key from Ctrl + t to the Windows key (so Win, release, then c to bring up a terminal), and the exec rpws init 12 -k line, which sets up 12 workspaces. (switch between them using Alt + Fn, eg Alt + F2 for workspace 2) There are a few variants of Ratpoison around, StumpWM is a Common Lisp rewrite for example, and sdorfehs is a "modern" take on it.

Anti-Ratty utilities

Ratpoison includes a few utilities that aren't used by default in /usr/share/ratpoison, including sloppy and click to focus extensions, but they are somewhat hackish. We could also mention two utilities that aren't directly related to Ratpoison, except in spirit perhaps, ratmen and keynav. The first is a nice alternative to dwm's dmenu. To give the user a menu of web browsers for instance, run ratmen chrome "" firefox "" textbrowser "lynx". (you only need to spell out a command if it isn't identical to the label) keynav is used to navigate the mouse with the keyboard. Run keynav in the background, and hit Ctrl + ; (semicolon) to activate it. Then use the vi motion keys h,j,k,l to split the screen in that direction, continue splitting until you've got the region you want, then hit Space to click the left mouse button. (the process usually takes somewhere between 3 and 12 key presses)

Notion - Cosy Tiler with a Troubled History

The Ion window manager has a troubled history. It was perhaps the first window manager to really champion the efficiency of a tiling approach. Sadly though, the developer got into some nasty disagreements with Linux distros/BSD's about unauthorized patches to his code. And he is not the only developer who is disgruntled over the fact that copy-left licenses give users all the rights, and the authors none. (of course, copy-right licenses have the exact opposite problem. Wouldn't it be nice if we all could get along and respect each other? But I'm just rambling as usual) The controversy lasted years and ruined the force that Ion could have been in the OpenSource community. Nevertheless, it's ideas have strongly influenced other tilers. Most notably wmii, and its later fork i3. In recent years a community driven clone has emerged (with the authors passive blessing it seems?) called Notion, and it is this fork that we will examine here.

Notion is a very different beast from Ratpoison, despite that fact that the fundamental concepts are much the same. (one big difference though is that your grid configurations in Notion persists across sessions) You manually divide the screen into "frames", each of which can hold a number of non-overlapping windows. But there are two key differences to Ratpoison that makes all the difference: graphics and mice action. The frames have tabbed title bar that you can click. You can also drag such a tab to another frame and you can hold down the Win (Mod4) key and drag the frame to resize it. Notion also supports floating windows, Press Win + Shift + d to detach/reattach it to a tiling frame. To move to another workspace you must first create it with Win + F9, you can then move to workspace 2 with Win + 2. You can use the main menu (F12) to quit. Notion is a hidden gem that I think many would enjoy using, just beware that you'll need xterm installed for the default configuration to work. You'll also find a nice cheatsheet on their webpage.

Honorable mention: i3

i3 is a community fork of the old suckless tiling window manager wmii. (development of wmii became dormant as the developers moved on to dwm) i3 feels somewhat like a blend between dwm and notion; it is a manual tiler with tabbing and stacking layout support. This means that window management is perhaps slightly less efficient then dwm, but arguably more powerful. (the tabbing/stacking feature also negate much of the benefit of dynamic tiling) Compared to notion though, the role of tabs and mice action is somewhat downplayed. i3 is not the lightest or most flexible tiler around, but it is very popular. It has good default keybindings, supports modern widescreens well, and is arguably the only X11 window manager that has a Wayland port, Sway, in widespread use.

Honorable mention: Herbstluftwm and bspwm

Herbstluftwm and bspwm, both manual tiling window managers, are newcomers to the genre, but they are solid contenders. Especially on modern setups where you might want to carve up a bigscreen monitor into multiple virtual "screens". The striking feature of both is that the window manager is entirely controlled by issuing commands to it by a client program. The startup configuration, often a shell script (but that's up to you), essentially runs a series of commands to set up the keybindings and other settings you like. So in a sense you "build" the window manager you want. This does require a bit of effort, but it also gives these tilers tremendous flexibility. If you like tweaking your tiler to perfection, then take a look at Herbstluftwm or bspwm.

Tiling Window Managers - Dynamic

Dynamic tilers take the concept of automatically assigning window dimensions one step further - auto assign placement too. This makes them much more efficient at creating and destroying windows then the manual tilers, at the expense of control and, arguably, focus. For most day-to-day environments, where adjectives like "hectic" and "chaotic" tend to apply, this seems like a good trade off.

dwm - The Mother of Dynamic Tilers

Although not the first in the genre, dwm has probably championed dynamic tiling window managers more then any other. It's the suckless team's second tiling window manager. These developers have a somewhat deserved reputation as simplistic bigots.* And to be sure, if you want to change the border color in dwm or some such triviality, you have to edit the config.h header and recompile. What could be easier then that? You would think that such an attitude would result in a hostile window manager that would make even Ratpoison feel like a caring nanny! You'd be wrong.

The organization is simple; Add a few terminals with Alt + Shift + Return. You'll see one big master window to the left, and smaller windows stacked to the right. You can hover over one of the smaller windows and swap it to the big "master" area with Alt + Return. You can also hold Alt and drag it out of the tile by left clicking, and manage it like any other floating window manager. (hold Alt and left/right click'n drag to move/resize) To pop it back into the tile hold Alt and middle click. To make a window fullscreen (or "monocle"), hit Alt + m. Hit Alt + t to go back to the default tiling layout. You can just click on the numbers at the top to navigate to a different workspace. Hit Alt + Shift + c to close an application, and Alt + Shift + q to quit dwm. Hit Alt + p to run an arbitrary application with dmenu. If you don't see the web browser after starting it, check the 9th workspace ;)

This is just a whirlwind tour, but hopefully it illustrates that dwm is easy to use. Although patching it may seem daunting, it really isn't all that hard, and once you learn the ropes, you'll discover that there are literally hundreds of community patches out there for any and all needs. Of course, dwm has spawned many forks, awesome, echinus and Xmonad are but three. (not to mention dvtm - dwm on the console). Xmonad's choice of programming language, Haskell, has spawned further forks, Qtile (written in Python), LeftWM (written in Rust) and spectrwm (not written in Haskell). All of these forks are serious contenders in their own right, and it feels a bit unfair to only feature dwm here. Nevertheless, going over each of these forks will quickly become redundant, as they all behave fairly similarly. The good thing though, is that once you've mastered one, it will be easy to jump into another variant and try it out. Maybe you'll find the tiler you've always dreamed of? if not, patch dwm to the next incarnation!

What tiler should I choose?!?

In contrast to stacking window managers, let alone desktop environments, tiling window managers are often visually indistinct. To make matters worse, they are often functionally similar. And yet, you'll find die-hard fans out there who cry out the merits of his or her favorite tiler, as if they were wholly unsympathetic towards the confusion of newbies.

Although there are some big differences (eg. manual or dynamic), generally speaking, it doesn't matter. If it helps, think of it as football; You don't need to scientifically discover the "best" team to enjoy the sport (and making those kinds of inquiries will only give you a bloody nose), pick a team you like and roll with it.

Miscellaneous

Usually, Linux/BSD GUI's are divided into two major categories; Desktop environments, such as GNOME and KDE, that brings a large collection of software and comprehensive toolkits, such as GTK and Qt, for developing similar graphical applications, and standalone window managers, that only manages windows, and leaves it up to the user to go out and get the applications he needs. In actuality, the OpenSource world of desktops isn't quite that clear cut. In this section we include some oddball desktops that don't quite fit either the window manager or the desktop environment paradigm.

EDE - Desktop without GTK/Qt?

The Equinox Desktop Environment is, as the name implies, a desktop environment, not a standalone window manager. But it's different enough that I thought it might merit a mention. It follows the familiar Windows 95-esque GUI and is easy to use, to the point of being down right dull. In my tests EDE used ~150 Mb of RAM, which is heavy indeed compared to the window managers in this article, but very light compared to more mainstream desktop environments. (Lxqt used ~310 Mb and Xfce ~450 Mb)

The outstanding feature of EDE is the fact that it's written in FLTK. (The Fast Light Tool Kit, or "fulltick") The vast majority of Linux/BSD desktops and GUI being written in GTK/Qt, makes this a fairly unique choice. As a fun thought experiment - what would a world without GTK/QT look like? (naturally we could just use command line utilities to do our work, but lets play along and look for GUI only applications with alternative toolkits) We have plenty of choice when it comes to terminal emulators, eg. xterm, urxvt, st, Eterm, alacritty. Most games can also be installed without GTK/Qt. Our web browser though would have to be the FLTK powered dillo, and irc chatting could be done with the TK powered tkirc/irctk, but a graphical email client would be a problem. For file manager, text editor and image viewer, we could use xfe (it includes xfw and xfi), which uses its own FOX toolkit. And there are some other choices for image viewers, such as xv. We could use the old 3.x version of xpdf (alternatively mupdf), gv and xman (alternatively tkman) to view our documents. mpv/mplayer to watch videos, and I suppose tkdvd and xcd to burn and play CD's, assuming we still have these relics laying around somewhere. Other basic desktop utilities could be xcalc and tuxpaint.

Although it is possible to set up a rudimentary desktop using only FLTK/TK (and other basic toolkit) applications, it is a rather bare bones affair. The lack of a modern web browser is perhaps the most painful omission. In all likelihood we would have to write some GUI programs ourselves. Scary I know, but FLTK or Tk (the toolkit part of Tcl/Tk) provide easy ways to write simple GUI apps. To illustrate the point, the above list of non-GTK/Qt apps lacks an audio player. (xcd isn't very useful unless you want to get oldschool and play a compact disc) But if all we need to do is select a directory with audio files to play, it's simple enough to just write an app in Tk:

#!/usr/bin/env wish
# tkplay - play a directory of audio files

label .dir -textvariable DIR
button .choose -text "Dir" -command {
    set DIR [tk_chooseDirectory]
    cd $DIR
}
button .play -text "Play" -command { exec play {*}[lsort [glob *]] & }
button .stop -text "Stop" -command { exec pkill -f play & }
button .quit -text "Quit" -command { exit }

grid .dir -columnspan 4
grid .choose .play .stop .quit
            

We're using the play command from the SoX package to play our music here (the ungainly Tcl line play {*}[lsort [glob *]] simply means play * in shell speak), and pkill to stop it. Of course, this is a rather crude example, but hopefully it illustrates that writing simple GUI tools for your own personal needs does not have to be an impossible task. What do we gain though by dropping GTK/Qt? Honestly, not much. The core GTK/Qt libraries will take somewhere between 50 and 100 Mb of disk space each. Since it's common to install both, and to have two or three versions of each to support old and new applications, they can consume up to half a gigabyte. That's still not a big deal for day-to-day systems, but it could be significant in constrained environments. In terms of memory, the simple applications we have discussed here will usually consume noticeably less then the more mainstream alternatives (our Tk audio app will use 30 Mb, whereas audacious will use 90 Mb), but that has more to do with crudeness then toolkits.

Irrelevant mention: GNUstep

Things would indeed look bleak if we lived in a GTK/Qt free world, as we discussed above. Yet in such a dystopia, there would still be a shining light of.., no that's not right, a dim light of hope.., nope, let me try again... a tiny spark of not quite total darkness - GNUstep! GNUstep is an OpenSource attempt at recreating the Apple Cocoa API's and the Objective-C programming environment. The project has spawned some 60 desktop applications, ranging from PIM tools, audio players, database and educational programs, image and PDF viewers, a handful of games, network clients and miscellaneous desktop utilities. There was considerable interest in the project in the late 90's and early 2000's, but since then the project has grown increasingly dormant. Half the utilities it provides are now in practice broken and/or obsolete. Although you could run GNUstep applications in any desktop, it works best in Window Maker. As for being lightweight, GNUstep is not spectacular.

ROX - RiscOS on X11

I've been curious about the RiscOS clone for X11 for some time, but I never really dug into it since it seemed that the ROX Desktop was dormant. And to be sure, it is. But recently I stumbled over the fact that you don't need to use the "ROX Desktop" to run ROX as a desktop, all you need is rox-filer and a window manager to power it. One way to set this up would be to install Openbox and add rox -S to ~/.config/openbox/autostart. That's it! Just fire up Openbox and you have a RiscOS-like desktop going on.

So how do you actually use ROX? The RiscOS interface, that ROX emulates, is centered around the file manager, in fact the entire desktop is a file manager. So how do you use a file manager as a desktop? Let's change the wallpaper for instance; right-click the root window and select "Backdrop...", a window pops up and asks you to "Drop an image" into it. So do that; Click on "Home", navigate to the Picture you like, then drag-and-drop it into the appropriate window. Easy Peasy. (right click in a ROX file manager and choose "Options..." -> "Thumbnails" -> "Show image thumbnails", if you want thumbnail previews in your file manager)

To open up a file, you can just click it to open it up with the default application for that file type. (right-click, choose the filename, then "Set Run Action..." if you need to specify a different default - eg. vlc "$@" for video files) And you can select multiple files and drag them onto the program you want to open them up with, MP3's onto an audio player for instance. But it's a little unwieldly to find the right program in /usr/bin, or wherever it might be, so let's make a convenient launcher: Open up a file manager and navigate to /usr/bin, find the program you want, say vlc, then drag and drop this to the desktop. (or you can drag it to the panel or the "Apps" directory, whichever you prefer) It won't have a nice VLC icon though. No matter, Google for an icon you like and put it in ~/.icons. Then right click your VLC launcher, select the filename, then "Set Icon...". Now drag and drop the icon you want, just as you did with the wallpaper.

Finally, there are situations where you cannot simply drag and drop a binary, you may need to create some functionality. That's easy too as it turns out. ROX has the convention that a directory containing an executable called AppRun, will run that command instead of opening the directory. Do you want a launcher for your online bank for example? Just make a directory, we can call it Bank, and add the following script in ~/MyApps/Bank/AppRun:

#!/bin/sh
chrome https://www.myonlinebank.com
            

Another example; ROX does not include a shutdown button! No matter, we can just create one in ~/MyApps/Quit/AppRun:

#!/bin/sh
sudo shutdown -h now
            

What's striking about this approach is its intuitiveness. Of course, you must know where your files are (let alone what they are), in order to use ROX. But if you do, it's child's play. Depending on your habits though, it could take a while to set up all the launchers you need.

The ROX project has also made a terminal emulator called ROXTerm. It is reasonably lightweight, about on par with Xfce's terminal. (the ROX file manager, rox-filer, is also more or less on par with Xfce's file manager, thunar, as far as resource requirements are concerned) Compared to the window managers in this article, the ROX desktop is a tad on the heavy side, but it's super lightweight compared to your average desktop environment! In any event, RiscOS has a very different way of doing things, and it's fun to play with.

Obsolete mention: CDE

The Common Desktop Environment (CDE) was indeed the standard desktop for commercial Unix systems back in the 90's. For its time, it was a big professional desktop with some heavy duty commercial backing. Gradually though it lost the competition to OpenSource alternatives like GNOME and KDE. In 2012 however the source code was released under LGPL, and it has received modest maintenance from the community. You can install CDE today on most Unix-like (eg. Linux/BSD) operating systems. Although it was considered a fairly heavy desktop in the early 90's, it is of course very lightweight and snappy by todays standards, consuming about the same amount of memory as ROX or a moderately extended window manager. It is fun to play with CDE and go back in time, as it were. The desktop also had some useful features, such as a ROX-like drag-and-drop functionality and a Korn shell with desktop scripting abilities. Using CDE seriously though as a day-to-day desktop is awkward, since it lacks many features that we take for granted today, and because major parts of the desktop is effectively broken due to code rot. (the Mail and Calendar applications being primary examples)

If you like the retro aesthetics of CDE but want modern applications (and don't much care about the special features of CDE), a good alternative might be NsCDE (the Not so Common Desktop Environment). It's an FVWM hack made to look like CDE, but using modern applications. (eg. Thunderbird for Mail and Calendar and Xfce/Mate apps for desktop utilities)

Emacs as a Desktop

As any Emacs fans will know, this text editor has its own internal window management, and can indeed do anything you need to do on a computer. (eg. run an arbitrary command with M-!) But you can take this a step further and turn Emacs into a fully fledged window manager. So that launching Firefox, or what have you, opens up in an Emacs buffer rather then spawning an external window. And naturally, you can simulate multiple workspaces as well. The first step is to run M-x package-install, then exwm.

You'll need to edit ~/.emacs a bit to set things up, a minimum would be:

(require 'exwm)
(setq exwm-workspace-number 9)
(add-hook 'exwm-update-class-hook
  (lambda () (exwm-workspace-rename-buffer exwm-class-name)))
(setq exwm-input-global-keys
      `(([?\s-r] . exwm-reset)
        ([?\s-w] . exwm-workspace-switch)
        ([?\s-&] . (lambda (cmd)
                     (interactive (list (read-shell-command "$ ")))
                     (start-process-shell-command cmd nil cmd)))
        ,@(mapcar (lambda (i)
                    `(,(kbd (format "s-%d" i)) .
                      (lambda ()
                        (interactive)
                        (exwm-workspace-switch-create ,i))))
                  (number-sequence 0 9))))
(exwm-enable)
            

This will set up the keybindings Win - r to restart exwm, Win - w to interactively switch to another workspace (or you could just type Win - n where n is a workspace from 0 to 9) and Win - & to run a command. Of course, being Emacs, you likely want to set up some additional things too. But I'm sure I don't need to tell you that. DistroTube has some nice videos on the subject if you're interested.

There are limitations though. The biggest drawback is probably the fact that Emacs is single threaded. Since exwm is just an Emacs plugin, the window manager is single threaded too. This can cause serious stability and lag issues on busy desktops. Being a minimalist, I feel I have to point out that Emacs itself isn't the slimmest gazelle around.* "EMACS stands for Eight Megabytes And Constantly Swapping", to quote the old joke from a time when that was considered a lot. Today though a heavily extended Emacs session can compete with lightweight desktop environments in resource consumption. (Of course, that might give some indication of what this editor can do)

Plan9Port - Unix backporting

Plan 9 is a fascinating operating system in its own right. If you want to try out the real deal, you can check out my previous guide on the subject. But lets assume you want to set up a Plan 9-like desktop environment on Linux/BSD, can you do that?

Yes and no. Plan 9 from User Space, aka plan9port, aka p9p, is an attempt to port the Plan 9 software to Unix-like systems. (eg. Linux/BSD) It includes many of the notable applications, such as Acme, and it will let you write shell scripts and C code in a Plan 9-like environment. But it does fall short of the real Plan 9 experience in many fundamental ways. It's also somewhat fiddley since it's an alien environment shoehorned on top of Unix. Plan 9 has many commands with similar names, which behave differently. For example, Plan 9 terminals do not auto scroll but waits for the user to manually scroll down as output is written. This behaviour makes pagers like less unnecessary, and Plan 9's man command just prints the manual verbatim. On the Unix side of things, always having to pipe the man output to a pager is annoying, which is why Unix's man command automatically opens up a pager and writes special escape characters that more/less understands.

This, and other situations, can cause conflicts in plan9port. You're given two commands to help you out in such sticky situations, 9 and u that explicitly launches a command in a plan9port or Unix environment. For example, if you're running a Unix shell in a Plan 9 terminal (bash + 9term), you likely want to run 9 man cmd to read the manual with plan9ports man command. If you're running a Plan 9 shell in a Unix terminal (rc + xterm), you likely want to run u man cmd to read the manual with the native Unix man command. (by "Unix" here we mean Linux/BSD) It is fiddley, and getting the various plan9port components up and running can be even more hairy. Sadly, some of the most interesting pieces of plan9port, such as networking, security and filesystem utilities, are also the pieces that are in most dire need of renovation. (9front has made important progress, but as of yet, this development has had little effect on plan9port) Even with all of it's limitations, it is an eye opening experience to see what plan9port allows you to do in Unix. And as for being lightweight, well, there just is no comparison.

Honorable mention: TTY

Using the console as a desktop is a rabbit hole that we'd like to avoid in this article. But since we are on the topic of window managers we could briefly mention that there are a few candidates for the text based console (or "TTY") as well. (the technical term is "terminal multiplexers") As mentioned GNU screen (the precursor to tmux) actually inspired Ratpoison, and vice versa, dwm inspired the dvtm terminal multiplexer. And there are a few other candidates besides. As for stacking terminal multiplexers, there is at least one, twin. (though I recommend the 'tilers')

Appendix

How Do You Switch Desktops?

If you come from a Windows/Mac background, the idea of replacing your desktop may sound about as fun as replacing your teeth! Only professionals ought to do that - and with ample anesthetics! How do you even go about changing the desktop? And if you fumble it up, how do you get your old desktop back?!?

Relax. Assuming that you have X11 installed, and you likely do even if you're running Wayland, you don't have to change your desktop at all to try out the window managers in this article. Just run Xephyr :2 -screen 1280x720 in a terminal. Then run DISPLAY=:2 startfluxbox in another terminal to launch Fluxbox in this virtual screen. 2 here refer to your screen ID, it doesn't matter what number you give it, as long as it's a number that no other screens are currently occupying. (so try another number if it doesn't work) You can of course change the resolution and window manager to your liking. Most window managers are started simply by running the executable with the same name (eg. dwm, cwm, twm), but some of the bigger (or weirder) window managers have alternative startup procedures. Some examples would be:

If you want to take the plunge and switch to a window manager on a more permanent basis, there are various ways to do it, depending on what display manager (aka login manager) you are using. Many modern display managers will let you choose from the available sessions in /usr/share/xsessions. If you don't see the window manager you've just installed, you might need to write such a session file by hand, eg. /usr/share/xsessions/ratpoison.desktop:

[Desktop Entry]
Name=Ratpoison
Comment=A super user-friendly desktop
Exec=/usr/bin/ratpoison
            

Alternatively, you could go hard core and run sudo systemctl set-default multi-user.target to boot into a text based environment. (run sudo systemctl set-default graphical.target to go back to a graphical login)* From here you can add the window manager startup instructions to ~/.xinitrc, eg:

exec ratpoison
            

This method also works well with the rusty old XDM display manager, just link the xinitrc file to xsession: ln ~/.xinitrc ~/.xsession, But let me stress; Unless you know what you are doing, follow the two first suggestions! (and try another window manager then Ratpoison first)

A Command-line Primer

When using a standalone window manager, there are numerous day-to-day operations you need to do, that the desktop doesn't provide an obvious way of doing. Although you can expand the bare foundations with various 3rd party applications, which we'll get into shortly, realistically you'll need to get comfortable with the command line in order to thrive in a standalone window manager. Some easy suggestions for day-to-day tasks in the command line might be:

You might find yourself thinking, "Is it just me, or does this seem overly tedious..?" It's not just you, we all think so, including us that are comfortable with the command line. The difference is that we've realized that you can easily customize the command line to suit your workflow. You could for example add these lines to your ~/.bashrc:

alias wifi=nmtui
alias volume=alsamixer
alias resolution=xrandr
alias open=xdg-open
alias usb=lsblk
mountusb(){  sudo mount /dev/$1 /mnt ;}
removeusb(){ sudo umount /mnt ;}
alias df='df -h'
alias killx='sudo pkill Xorg'
alias reboot='sudo reboot'
alias shutdown='sudo shutdown -h'
            

And now suddenly the tedium is significantly reduced! We just type shutdown instead of the unwieldly sudo shutdown -h, and we have easy to remember commands like wifi, open and usb. You also don't need to spell out a command all the way, just type in the first couple of letters and hit Tab to auto complete the rest. For more advanced users, it's customary to add something like export PATH=$HOME/bin:$PATH in ~/.bashrc, so that you can invoke any of your scripts in ~/bin by typing their name.

3rd Party Utilities

In addition to a little command line know-how, as we discussed above, there are numerous 3rd party utilities that can augment a window manager in various ways. Exactly which utilities you need depend greatly on the particular limitations of your window manager and your own personal preferences. The following list is not exhaustive, but it might provide you with some useful hints.

As for basic applications, like file managers, text editors, image viewers etc, there are just too many candidates to mention. A simple tip, if you're new to window managers, is to install your favorite desktop environment (eg. Xfce, Mate, LXQt), and just use the applications it provides. (Xfce includes the utility xfce4-appfinder that can help you out if you don't know the application names)

What about Wayland?

In this article we have focused on X11 window managers, since obsolete is my style. But one may wonder; are window managers doomed now that there's a new display server in town? As it turns out, no. Besides the fact that Linux/BSD is a big enough town for two of 'em, there is actually much work being done to bring the old X11 window managers to Wayland. hikari, labwc, wlmaker, wio, Cagebreak, Sway, dwl, river and vivarium, to mention a few, are clones/inspired by cwm, Openbox, Window Maker, rio, Ratpoison, i3, dwm, bspwm and Xmonad. It's still early days though, and you won't find all of these compositors in all repositories. (while Arch and FreeBSD include most, Debian and OpenBSD only include Sway for instance) Still, chances are good that you'll enjoy plenty of Wayland choice in years to come. (and yes, Wayland has been ported to all the BSD's)*

Will Wayland though simplify development and reduce system resources? It seems so. To illustrate; Openbox, dwm and cwm consumes ~21.5, ~10 and ~9.5 Mb of RAM on my tests, and have ~53 500, ~2500 and ~5700 lines of code. In comparison, the Wayland equivalents labwc, dwl and hikari consumes ~40, ~30 and ~39 Mb of RAM and have ~46 400, ~3300 and ~18 600 lines of code respectively. At first glance this doesn't seem lighter, but remember that an X11 window manager is just a thin layer on top of the X11 display server. (which consumes ~100 Mb of RAM) Wayland is just a protocol and library, so a compositor is its own display server, meaning that it has to carry much more of the implementation burden. Glancing at the code is even more convincing. Whereas X11 is about 8 million lines of code, Wayland, including protocols and utilities, is only ~50 000. (most of the above mentioned compositors also depend on wlroots which adds another ~80 000 lines)

For us X11 graybeards though, migrating to Wayland does requires some effort. On my tests I needed to tweak OpenBSD's settings a bit to get the mouse working right,* replace the X11 screenshot utility scrot with grim, replace the X11 terminal xterm in ~/.sway/config to foot (optional of course, but It's a drag to run Xwayland if you don't have to), and lastly set my keyboard layout to dvorak in ~/.sway/config, since setxkbmap won't work: (not all X11 applications will work in Wayland, even if XWayland is running in the background)

input type:keyboard {
	xkb_layout dvorak
}
            

Concluding thoughts

In our brief review, we've given quite an uneven coverage of some major players among the X11 window managers. I've gone off on some random tangents here and there, and while the specifics may not be all that relevant for you, I hope you found it inspiring. A theme in these examples is that you can tweak any window manager to suit your needs, and while perfection might be out of reach, a "good enough" solution is often achievable with modest efforts.

I had a lot of fun writing this article, and I hope you enjoyed reading it. Much of the limelight nowadays go to the big desktops, and sure enough, there is great work being done there. But it's easy to forget just how versatile, powerful and down right weird the old window managers can be. Maybe you'll have a blast exploring them?

Have fun!