Probabilistic extension for dmenu

dmenu is a great tool for selecting options from a list. It is a simple and efficient. I’ve used it for many years together with different wm’s like wmii, sway and worm.

For my own use, I have written a probabilistic extension for dmenu. It is called fdmenu. It is written in C and uses the libidentif library for probabilistic selection. The code repository is linked from the project page. The library is part of an old project of mine written several years ago and now abbandoned.

With this extension, you can use the command line argument -prob to enable probabilistic selection instead of the default substring matching. The probability is calculated based on the similarity of the input string and the list of options. With the argument enabled, dmenu will list the options in descending order of probability.

The extension is very simple and does not require any additional dependencies. It is a single file that can be compiled together with dmenu. Instead, if you want a more advanced probabilistic selection, fzf is for you.