Preselect - bakkeby/dmenu GitHub Wiki

The preselect feature is only available as a command line argument and it allows for dmenu to start with a given item already pre-selected.

As an example we will compare the following dmenu commands, the first of which just passes the list of files in the current directory to dmenu.

$ ls | dmenu

preselect1.jpg

As we can see the leftmost item is selected by default.

Then we have the same command but passing the -ps command line option to make the third option pre-selected. The value is 0-based hence we pass in 2.

$ ls | dmenu -ps 2

preselect2.jpg

The above shows that dmenu starts with "config.def.h" being pre-selected.

This feature originates from the preselect patch for dmenu.

Back to Features.

⚠️ **GitHub.com Fallback** ⚠️