Last modified: March 23, 2026

This article is written in: 🇺🇸

Dynamic Window Manager (DWM)

The Dynamic Window Manager (DWM) is a minimal, lightweight, and highly efficient tiling window manager designed to help you manage application windows in a clean and distraction-free manner. Instead of overlapping windows as seen in traditional window managers, DWM organizes windows in a tiled layout, making it easy to see and navigate multiple applications simultaneously. DWM is based on the X Window System, making it suitable for use on Unix-like operating systems.

DWM stands out for its extreme simplicity and high customization capability. It is part of the suckless software philosophy, which emphasizes clarity, simplicity, and resource efficiency.

dwm

Here's how DWM looks in action. Each window takes a portion of the screen, allowing for easy multitasking.

Installation

Installation of DWM is straightforward. If you're on a Debian-based system such as Ubuntu or Mint, you can install DWM and its related suckless-tools packages using the following command in your terminal:

sudo apt install dwm suckless-tools

The suckless-tools package contains additional utilities developed by the suckless community, including dmenu, a fast and lightweight dynamic menu for X, and slock, a simple screen locker utility.

After installation, you can choose DWM as your window manager from the login screen.

Remember that DWM is highly customizable, but changes typically require modifying the source code and recompiling. So if you're up for some tinkering, you can clone the DWM source code from the suckless website, make changes to suit your needs, and then build and install your custom version of DWM.

Usage

Configuration

Unlike other window managers that use configuration files, DWM is customized by directly modifying its source code and then recompiling it. This approach provides a lot of flexibility and control over DWM's behavior and appearance. The main configuration is located in the config.h file, which can be found in the DWM source code directory.

Follow these steps to customize DWM to your preferences:

Download the DWM Source Code

You can clone the source code from the official suckless git repository using the following command:

git clone https://git.suckless.org/dwm

The config.def.h file contains the default settings. To customize DWM, you should first copy config.def.h to config.h. Then, you can edit the config.h file with your preferred text editor (e.g., nano, vim, emacs). Here's how to do that:

cd dwm
cp config.def.h config.h
nano config.h

Customize the config.h File

In the config.h file, you can change various settings according to your preferences. For example, you can modify key bindings, set custom colors, define the status bar's appearance, and select the default font.

Changing the Border Configuration:

I. Within config.h, locate the section where the border settings are defined. It typically looks like this:

static const unsigned int borderpx  = 1;        /* border pixel of windows */

borderpx controls the width of the border around each window. The default value is usually 1 pixel.

II. To increase or decrease the border width, change the value of borderpx. For example, to set the border width to 2 pixels, change the line to:

static const unsigned int borderpx  = 2;

If you want to remove the border entirely, you can set borderpx to 0:

static const unsigned int borderpx  = 0;

III. The border color for both focused and unfocused windows is defined in the color scheme section of config.h. Look for the following lines:

static const char col_gray1[]       = "#222222";
static const char col_gray2[]       = "#444444";
static const char col_gray3[]       = "#bbbbbb";
static const char col_gray4[]       = "#eeeeee";
static const char col_cyan[]        = "#005577";
static const char *colors[][3]      = {
   /*               fg         bg         border   */
   [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
   [SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
};

Here, col_cyan is used for the border of the focused window, and col_gray2 is used for the unfocused windows. To change the border color, replace the hex color code with your preferred color. For example, to change the focused window border to red:

static const char col_red[]         = "#ff0000";
static const char *colors[][3]      = {

   /*               fg         bg         border   */

   [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },

   [SchemeSel]  = { col_gray4, col_red,   col_red   },

};

IV. After adjusting the border settings and any other customizations, save your changes and exit the text editor.

Compile and Install the Modified DWM

After modifying the config.h file, you need to compile the DWM source code and install the new binary:

sudo make clean install

This command will clean up any previous builds and compile your customized version of DWM.

Apply the Changes

To apply your changes, you need to restart DWM. You can do this by logging out and logging back in, or by restarting your X session. Once you log back in, the updated DWM with your new border settings and other customizations should be in effect.

Challenges

  1. Install DWM on a virtual machine or spare system. Launch several terminal windows and practice switching between them using the keyboard shortcuts (Alt + j, Alt + k). Document how DWM arranges the windows in its default tiling layout and compare the experience to a traditional floating window manager.
  2. Clone the DWM source code from the suckless repository and modify the config.h file to change the border width and border color of focused windows. Recompile, install, and verify that your changes take effect. Explain the process and why DWM requires recompilation for configuration changes.
  3. Customize your DWM key bindings by editing config.h to launch a specific application (such as a web browser or file manager) with a new keyboard shortcut. Rebuild DWM and test the binding. Discuss the advantages and disadvantages of source-level configuration compared to configuration files.
  4. Use DWM's tag system to organize windows across multiple workspaces. Open different applications on separate tags, practice moving windows between tags using Shift + Alt + [tag number], and explain how tags differ from traditional virtual desktops.
  5. Apply a patch from the suckless community (such as the gaps patch, systray patch, or autostart patch) to your DWM build. Document the patching process, rebuild DWM, and verify that the patch works as expected. Discuss how the suckless patching workflow compares to plugin systems in other window managers.
  6. Set up a custom status bar for DWM by writing a shell script that displays system information (CPU usage, memory, date/time, battery status) and pipes the output to xsetroot -name. Configure the script to run on startup and explain how DWM uses the root window name as the status bar text.
  7. Configure dmenu as your application launcher within DWM. Practice launching applications by typing their names, and customize the dmenu appearance (font, colors) through command-line flags or source code modifications. Compare dmenu with other application launchers you have used.
  8. Experiment with DWM's different layouts (tiled, floating, monocle) by cycling through them with Alt + Space. Resize the master area using Alt + h and Alt + l, and explain when each layout mode might be most useful for your workflow.
  9. Set up DWM for a multi-monitor configuration. Practice moving windows between monitors and assigning specific tags to each screen. Document any challenges you encounter and how you resolved them.
  10. Compare DWM with at least two other tiling window managers (such as i3, bspwm, or Awesome WM). Evaluate each based on configuration approach, resource usage, ease of customization, and community support. Summarize your findings and explain which one you would recommend for different types of users.

Further Resources