Dmenu is a lightweight dynamic menu. It’s mainly used as a program launcher for the dwm window manager but can do much more. I quickly saw it’s whole range of uses when implementing into my bash scripts.
The problem was that I was using X11 on my laptop when writing these scripts and when I switched to KDE on my desktop, which runs on Wayland, they stopped working. The reason is that dmenu is only written for the older X11 graphical server. Wayland is supposed to replace it but adoption has only sped up recently. When I decided to switch to wayland on my laptop aswell, I got more interested in finding a solution.
Dmenu On Wayland
There are multiple dmenu alternatives for wayland. There’s wmenu which is used as the default launcher in dwl (the dwm for wayland). It’s written from scratch so the code looks a lot different than the original dmenu.
A smaller project I found is mew, which I now prefer over wmenu. It’s a close copy of the dmenu source code but with changes to be wayland native. This makes it a lot easier to port patches because the code essentially has the same structure as the original dmenu. On top of that the source code is only half as big, coming in with around 1'000 lines.
When I looked at the issues tab on the wmenu git repo, I saw three requests for different patches. There was demand but nobody had answered. That’s when I realized that I would probably have to code the patches on my own.
Important Patches
Some of my must have patches are:
- center
- border
- noinput
The center patch is very important for me because it makes viewing options easier when using the vertical list option. But when the window is centered there needs to be contrast to differentiate dmenu from the background. This can be done with a colored border (it also looks prettier like that). And at last having the option to disable the text input box is useful for scripts where there are only a few predefined options.
Porting The Patches
None of the patches are very long so there is not too much to explain but I would still like to show some differences between the Wayland and X11. You can find the repo for the patches here.
To be continued…
Last updated on April 5th, 2026 by Leo Martin
Related Topics: