DWM (Dynamic Window Manager) is a minimal, tiling window manager for Unix-like systems that automatically arranges windows in a non-overlapping layout, controlled primarily through keyboard shortcuts. You configure it by editing its C source code and recompiling, which gives you a fast, lightweight desktop but requires a willingness to work with code. This article explains what DWM is, how it differs from other window managers, and what you need to know before trying it.
What Is a Tiling Window Manager?
Most desktop environments (like GNOME or Windows) use a “floating� window manager: windows overlap, and you drag them around with the mouse. A tiling window manager instead divides the screen into non-overlapping rectangles, or “tiles,� and places each window into one of those tiles. When you open a new window, the manager automatically resizes and repositions existing windows to make room. This approach eliminates the need to manually arrange windows and keeps every open window fully visible at all times.
DWM is one of the oldest and most influential tiling window managers, created by Anselm R. Garbe in 2006 as part of the suckless.org project. The “Dynamic� in its name refers to its ability to switch between tiling and floating modes on the fly, and to change the layout (e.g., from a master-stack layout to a monocle layout) with a keyboard shortcut.
How DWM Works
DWM is written in C and runs directly on top of the X11 display server (it does not use a desktop environment). It is extremely small—the entire program is a single C file (dwm.c) plus a few headers, and the compiled binary is typically under 100 KB. Because it is so small, it starts instantly and uses very little memory.
You control DWM almost entirely with the keyboard. The default keybindings use the Alt key as the “mod� key. For example:
- Alt+Shift+Enter opens a new terminal window.
- Alt+J and Alt+K cycle focus between windows.
- Alt+Space toggles between tiling and floating layouts.
- Alt+B toggles the status bar.
DWM also includes a status bar at the top of the screen that can display text from a script (e.g., system information like CPU usage or battery level). You set this up by piping output to the xsetroot command or by using a tool like dwmstatus.
Layouts: Master, Stack, and Monocle
DWM ships with three default layouts, each suited to different workflows:
- Master and Stack: The screen is split into a large “master� area on the left and a vertical “stack� on the right. The focused window is in the master area; all other windows are in the stack. You can increase or decrease the master area size with Alt+H and Alt+L.
- Monocle: All windows are maximized to fill the screen, but they are stacked on top of each other. You cycle through them with Alt+J/K. This is useful for focus-intensive work.
- Floating: Windows behave like a traditional desktop—they can overlap and be dragged with the mouse. This is useful for applications like GIMP or a file manager that need arbitrary sizes.
You can cycle through these layouts with Alt+Space. The layout is per-tag (virtual desktop), so you can have different layouts on different tags.
Tags Instead of Workspaces
Most desktop environments use “workspaces� or “virtual desktops� to group windows. DWM uses a concept called “tags.� Each window is assigned to one or more tags (numbered 1–9 by default). You can view a specific tag by pressing Alt+1 through Alt+9, which shows only the windows on that tag. You can also send a window to a different tag with Alt+Shift+1 etc. Tags are more flexible than workspaces because a window can be visible on multiple tags simultaneously (e.g., a chat window on both tag 1 and tag 2).
Configuration: The Source Code Is the Config
Unlike most programs, DWM has no configuration file. Instead, you edit the config.h file (or config.def.h for the default) and then recompile the source code with make. This is a deliberate design choice by the suckless project: it avoids the overhead of parsing a config file at runtime and keeps the code simple. However, it means that to change any setting—keybindings, colors, fonts, border width, even the number of tags—you need to edit C code and run a compiler.
For example, to change the mod key from Alt to Super (the Windows key), you edit the line #define MODKEY Mod1Mask to Mod4Mask and recompile. To add a new keybinding, you add a line to the keys[] array. This process is not difficult for anyone comfortable with basic C syntax, but it is a significant barrier for casual users.
Common Problems and Misconceptions
New DWM users often run into a few predictable issues:
- No desktop icons or wallpaper: DWM does not manage the desktop background or icons. You need a separate program like
fehornitrogento set a wallpaper, and file managers likepcmanfmcan provide desktop icons if you really want them. - No system tray: DWM does not include a system tray by default. If you need one (e.g., for network or battery icons), you can use a standalone tray like
stalonetrayortrayer, or install a DWM patch. - Mouse support is limited: DWM is keyboard-centric. You can click to focus windows, but you cannot drag windows to move them in tiling mode. Some users find this disorienting at first.
- “DWM is hard to configure� is a misconception: It is not hard if you know C, but it is unusual. The suckless philosophy is that configuration should be done at compile time, not runtime. If you prefer editing a text config file, consider a fork like
dwm-flexor a different window manager like i3 or bspwm.
Comparison with Other Tiling Window Managers
DWM is not the only tiling window manager. Here is how it compares to two popular alternatives:
- i3: i3 is a tiling window manager that uses a text-based configuration file (
~/.config/i3/config). It is easier to configure for beginners because you do not need to compile anything. i3 also supports multiple monitors more seamlessly and has a built-in bar. However, i3 is larger and slower than DWM, and its layouts are more manual (you decide the split direction). - bspwm: bspwm uses a binary tree layout and a separate daemon (
bspwm) plus a client (bspc) that you control from the command line or a hotkey daemon. Configuration is done via shell scripts, which is flexible but requires scripting knowledge. bspwm is similar in speed to DWM but has a different mental model. - Awesome: Awesome is a tiling window manager that is configured in Lua. It is more feature-rich out of the box (widgets, themes) but also more complex. DWM is simpler and more minimal.
In short, DWM is the most minimal and fastest, but also the most demanding in terms of configuration. If you value speed and simplicity and are comfortable with C, DWM is excellent. If you want easier configuration, i3 is a better starting point.
Is DWM Safe and Stable?
DWM is mature and stable; it has been actively developed for over 15 years and is used by many Linux users. Because it is small, it has a smaller attack surface than a full desktop environment. However, you should only install DWM from your distribution’s repository or from the official suckless.org website. Be cautious of third-party patches or forks that may introduce bugs or security issues.
One thing to note: DWM is written for X11, not Wayland. If you use a Wayland session (common on newer distributions like Fedora or Ubuntu 22.04+), DWM will not work natively. You would need to use an X11 session or a Wayland-compatible tiling compositor like sway (which is a drop-in replacement for i3).
Frequently Asked Questions
Do I need to know C to use DWM?
Not to use it, but yes to configure it. If you only want to try DWM with its default settings, you can install it and use it immediately. But to change keybindings, colors, or add features, you must edit the source code and recompile. Basic familiarity with C syntax (arrays, structs) is enough for most changes.
Can I use DWM with multiple monitors?
Yes, DWM supports multiple monitors via Xinerama or RandR. Each monitor gets its own set of tags and layouts. You can move windows between monitors with Alt+Shift+[monitor number] (default keybindings). However, configuration for multi-monitor setups is a bit more involved, and you may need to patch DWM for advanced behaviors like per-monitor status bars.
How do I set a wallpaper in DWM?
Use an external program like feh or nitrogen. For example, add feh --bg-scale /path/to/image.jpg to your .xinitrc or startup script. DWM itself does not handle the background.
What is the difference between DWM and a desktop environment?
A desktop environment (like GNOME or KDE) includes a window manager, but also a file manager, settings daemons, a compositor, and a suite of applications. DWM is only the window manager—it manages window placement and focus. You must provide your own terminal, status bar script, wallpaper setter, and other utilities. This is part of the minimal philosophy.
Is DWM a good choice for a beginner?
Probably not. If you are new to Linux or to tiling window managers, i3 is often recommended because it is easier to configure and has better documentation. DWM is better suited to users who are comfortable with the command line and willing to invest time in reading source code. That said, some beginners do start with DWM and learn C in the process.
How do I update DWM to a new version?
If you installed DWM from your distribution’s package manager, update it like any other package. If you compiled it from source, you need to pull the latest source from suckless.org, reapply your custom patches (if any), and recompile. The suckless project releases new versions infrequently, so updates are not a constant burden.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Flash Converter: What It Is & How to Use It
- Choosing a Pipe Flow Meter for Swirling Flow
- Motorola Phone Recovery: How to Recover Data
- Poco X3 GT Dimensity 1100 67W Fast Charging Launched?5.00 min/km
- Convert 2D Videos to Oculus Rift VR: How-To
- DRAM Light on Motherboard: Meaning & Fixes5.00 min/km