Dmenu Patches For Wayland


Dmenu is a small dynamic menu created by suckless.org. It is mainly used as a software launcher for the dwm window manager but It can do much more. I started using dmenu in my school bash program and quickly saw Its usefulnes in scripting.

But when I switched to linux on my desktop computer I had to give up all my scripts because I was using KDE on wayland. Wayland is a newer graphical server for linux which is supposed to replace the older X11. The problem is that all of the suckless programms are written for X11. There are ways to run X11 software on wayland but I never really got around to rewriting all of my scripts etc.

When I decided to move my laptop to wayland aswell I got more interested in porting the patches. I had some free time and I’ve always wanted to learn C so I jumped in

Dmenu On Wayland

There are many dmenu alternatives for wayland. I was attracted by wmenu because it’s used as the default launcher in dwl (the dwm for wayland). But when I looked at the issues on the codeberg page I saw three requests for different patches for wmenu. Some of them were posted 6 months ago. That’s where I realized that I would probably have to code these patches on my own. Dmenu for wayland is a very niche software for a niche window manager on a niche graphical server inside of a operating system which only few people use.

After some more searching I found 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 would make it a lot easier to port the patches because the code is very similar to the original dmenu. On top of that the source code is only half as big as wmenu coming in with around 1'000 lines of code. As I am not a C-developer it’s a lot nicer to go through less lines of code.

Important Patches

Some of my must have patches are:

  • center
  • border
  • noinput

The center patch is very important for me because I like to have a small window in the center and thus most of my scripts use this functionality. It makes viewing options easier when using the vertical list option.

When the window is centered I would like to make it more visible with a colored border. This is important to differentiate dmenu from the background. Dwm also uses a colored border for all of the programms so it’s also nice to have a more unified design.

And at last having the option to not have any input is very useful for scripts where there are only a few predefined options. For example I have a script that terminates the window but first asks you to confirm the selection. It looks nicer when only the options yes and no are visible without an input field.

Quick Porting Summaries

None of the patches are very long so there is not too much to explain but I would still like to lay out some niceties I encountered while porting. You can find the repo for the patches here.

To be continued…


Last updated on 6 January 2026 by Leo Martin

Related Topics: