Exploring the XMonad tiling window manager

Graphical Interface

Article from Issue 259/2022
Author(s):

Many users never look back once they get started with a tiling window manager. A close look at XMonad shows why.

I am not much of a graphical guy when it comes to computing. I know this sounds a bit clichÈ for a *nix nerd, but I live in the command line. I am a software developer and all I need is both vi/Vim and grep (no flame wars please) and a command line, preferably Bash, to use them in. I do all of my development out of locally hosted headless virtual machines and SSH into those virtual machines via a wonderful feature called port forwarding. The graphical desktop environment tends to be an afterthought for me, but even though that may often be the case, I still prefer it to be functional and allow me to remain productive.

I miss the days of simplicity when less was more. Nowadays, there are more desktop environments to choose from. Some of which are very lightweight while others dip into the heavier side of things. And while choice is never a bad thing, too much choice can often be intimidating. For instance, which desktop environment is best suited for you? Which features or functions are you looking for most? Are you looking for a composite window manager or a tiling window manager? Wait, what? What are composite and tiling window managers?

Window Managers

Many of us *nix users have grown used to the mainstream desktop environments, which include Gnome, KDE, Xfce, LXDE, or your preferred desktop environment, and it becomes difficult to fathom that others (still) exist – but they do. As unique as some of them may be, each is powerful in their own right. But before I dive into one particular desktop environment, I wish to cover the basics of window managers.

What is a window manager? In short, it is a piece of graphical software that controls the placement of windows (bearing your applications) in a windowing environment. The outcome of such a thing is referred to as a desktop environment. There are different types of window managers.

The composite window manager will draw each window separately and allow for them to overlap in either a 2D or 3D environment. And for those graphical environments that are not composite window manager environments but still allow for overlapping windows, those are referred to as stacking window managers. In order to emulate the look and feel of overlapping windows, the environment must be (re)drawn from the background window first, all the way to the foreground. When the user decides to bring one of the background windows forward or decides to open a new window, each window behind it will be redrawn.

Then you have the tiling window manager. Windows are in essence displayed side-by-side or above and below the others, resembling that of a set of tiles. This is the type of window manager I will explore here.

Last, you have the dynamic window manager. What makes the dynamic window manager unique is its ability to dynamically switch between composite and tiling window managers.

Introducing XMonad

Now that I have explained the very basics and key differences of window manager types, I will move onto a specific, and probably my most favorite, tiling window manager: XMonad [1]. XMonad is both a powerful and lightweight tiling window manager written in Haskell. It isn't often that you hear of Haskell, but XMonad runs well with it.

Installation and Initial Startup

While you can always build from source (and there is absolutely nothing wrong with that), most modern Linux distributions will provide precompiled binaries and packages for installing XMonad. To install XMonad on an Ubuntu or other Debian-based distribution, type the following on the command line:

$ sudo apt install xmonad dmenu

You may immediately notice that you are not only installing XMonad but also a dynamic and very lightweight launcher menu for X called dmenu [2]. You will soon know why you are going to need this menu application.

As soon as the applications (and their dependencies) are installed, log out of your current environment and, under your user profile (in the login manager), be sure to have XMonad selected. Then log back into the system (Figure 1).

Figure 1: Select XMonad at the login screen.

At first, you may find things a bit concerning: You will immediately be greeted by a black screen, almost as if nothing is loaded. Do not worry. This is XMonad. I will cover some customizations later in this tutorial, but for now, I'll start with the basics.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Tiling Desktops

    Tiling desktops have been experiencing a resurgence in popularity. Here are a few options that can help keep your desktop better organized.

  • Introduction

    This month in Linux Voice.

  • KDE Tiling Solutions

    If you want to reap the benefits of tiling desktops on KDE Plasma, check out these KWin script extensions.

  • Pop!_OS

    Pop!_OS, known for its innovation, customization, and user-friendliness, features one of the easiest tiling desktop options available.

  • Tutorials – WM Tiling

    Regular window managers are so 2016 – install a tiling WM and work faster, smarter, and cooler.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News