toki83w/dmenu: The Tiny Launcher That Treats Configuration Like Code

A pre-patched fork of dmenu that uses fuzzy matching, centered layout, and compile-time theming to prove that small tools can still feel personal, fast, and complete.

8 to 10 min read • View on GitHub • More from toki83w

A centered launcher window floats above a tiled desktop, with a typed query narrowing a short list of results. The scene explains how dmenu turns a keyboard into the primary control surface for the desktop.
dmenu shrinks the desktop to a single, focused interaction: type, narrow, select, exit.
Key Takeaways

The fork makes a strong claim before you even open the code: some software gets better by refusing to grow a settings UI. `toki83w/dmenu` is a personal, pre-patched version of a classic X11 launcher, and that matters because its features are not bolted on after the fact. They are compiled into the program itself.

Why this fork exists

Stock `dmenu` already has a clear philosophy. This fork leans into it harder. Instead of pretending to be a general desktop suite, it reads like one developer’s answer to a familiar question: what if the launcher were already in the exact shape you wanted, every time you built it?

That is the real hook. Not a menu. A stance. In Suckless land, the ideal configuration is often a patchset plus a `config.def.h` file, and this repository follows that logic closely.

What changed from stock dmenu

AspectStock dmenutoki83w/dmenu
Configuration modelEdit C headers and rebuildStill compile-time, but with the preferred patches already fused in
Matching styleUsually prefix-basedFuzzy matching for approximate queries
UI placementDefault bar-style placementCentered layout for a more modal feel
Theming approachHand-edited color constantsCatppuccin palette baked into the build
FeedbackPlain list behaviorNumeric counters for filtered results
Best use caseMinimal launcher baselineA tuned personal launcher for daily keyboard workflows
A close-up of a configuration header rendered as a mechanical control panel, with switches labeled centered, fuzzy, and color schemes. The scene explains how compile-time configuration becomes a finished binary instead of a runtime preference screen.
The fork’s personality lives in `config.def.h`. The choices are compiled, not toggled from a GUI.

The whole app is a pipe

The simplest way to understand `dmenu` is to stop thinking of it as a launcher. It is a filter. It takes lines on `stdin`, turns them into navigable items, narrows them as you type, and writes the selected result back to `stdout`.

This is the core mental model. `dmenu` is a streaming pipeline, not a full desktop app.

/* Conceptual shape of the data flow */
while (fgets(buf, sizeof buf, stdin)) {
    append_item(buf);
}

for (;;) {
    read_keyboard();
    match_items(query);
    drawmenu();
    if (selected)
        break;
}

puts(selected->text);

That model explains why the tool feels so light. There is no service, no indexer, no background database. The app does one pass over input, updates state in memory, and exits when the choice is made.

Why compile-time configuration still matters

`dmenu` uses the Suckless pattern: edit `config.def.h`, rebuild, move on. It is inconvenient in the way a good workbench is inconvenient. You have to touch the tool to change it, which also means you know exactly what changed.

That tradeoff is the point. Runtime configuration usually buys flexibility, but it also adds parsing, validation, schema drift, and a larger surface area for things to go wrong. Compile-time configuration reduces that surface and keeps the binary honest about what it is.

TradeoffCompile-time configRuntime config
Changing behaviorRequires rebuildChanges live through settings files or UI
ComplexityLowHigher
DiscoverabilityLowerHigher
AuditabilityVery highDepends on layers and defaults
User typePeople comfortable editing sourcePeople who want immediate toggles

In this fork, that philosophy is not softened. `centered`, `fuzzy`, `SchemeNorm`, and `SchemeSel` are not preferences stored elsewhere. They are the program.

The important internals

The codebase is compact enough to read in one sitting, but each file has a clear job. `dmenu.c` handles events, matching, and drawing. `drw.c` and `drw.h` abstract X11 drawing. `util.c` gives the project its fail-fast memory helpers. `stest.c` supports the shell workflow around `dmenu_run` and `dmenu_path`.

FileRoleWhy it matters
dmenu.cEvent loop and matchingThis is where stdin becomes a live menu
drw.c / drw.hDrawing layerKeeps Xlib details out of the main logic
config.def.hUI constants and feature togglesDefines the fork’s personality
util.c / util.hMemory and error helpersKeeps the code small and blunt
stest.cFile test helperSupports fast PATH scanning

The key data structure is the `struct item` list. Each item carries the text to show, links to neighboring items, and enough state to support ranking and navigation. That makes the menu feel immediate, because the renderer is always working with a simple in-memory model rather than a separate index layer.

The matching logic is just as direct. Prefix search is easy to reason about, but fuzzy matching is what makes a launcher feel forgiving. The fork uses that flexibility without turning the program into a search engine.

What modern launchers trade away

A richer launcher can be prettier, more discoverable, and easier for newcomers to pick up. It can also become harder to predict. Once a tool starts depending on plugins, runtime state, or background services, the user often gets convenience at the cost of clarity.

`toki83w/dmenu` sits on the other side of that line. It gives up animation, rich indexing, and a broad settings surface. In return, it stays composable, transparent, and extremely easy to script around.

Categorytoki83w/dmenuTypical modern launcher
Startup behaviorInstant and simpleOften heavier and more layered
CustomizationEdit source and rebuildUse settings, themes, and plugins
IntegrationBest through pipes and scriptsBest through built-in features
Mental modelOne filter, one outputMany modes and screens
Long-term feelStable and legibleFeature-rich but more complex

That is why this fork still feels relevant. It is not nostalgia. It is a reminder that a tool can be small, opinionated, and complete without trying to become a platform.

Why this still feels relevant

The lasting lesson is not that everyone should compile their launcher. It is that constraints can produce better software when the constraints are chosen well. `toki83w/dmenu` takes a classic Unix utility and shows that modernization does not have to mean abstraction inflation.

Sometimes the most modern-feeling interface is the one that stays closest to the machine, the shell, and the user’s own habits.