bakkeby / dmenu-flexipatch

A dmenu build with preprocessor directives to decide which patches to include during build time
MIT License
183 stars 78 forks source link

Is it possible to have dmenu return other exit codes on pressing `Alt-Enter` or other combination? #18

Closed UtkarshVerma closed 1 month ago

UtkarshVerma commented 1 year ago

I am writing a script and want to have to possible set of actions based on which key was used to make the selection in dmenu. For example, I can either press Enter (return code 0) or Ctrl-Enter (return code 10). Both will only output one entry and based on the exit code, I can go for different actions in the script.

Is this possible?

bakkeby commented 1 year ago

Sounds like an idea that would likely conflict with many other ideas. Like how you can select more than one item for output or using the mouse to select options.

Rather than the exit code you could potentially use the separator patch and return either the text part or the value part depending on whether you press Enter or Alt+Enter for example. The default is to always return the value part.