cmenu is a cross-platform dmenu clone built with Raylib in ~500 lines of code.
Usage: cmenu [options]
Options:
-b --bottom Appears at the bottom of the screen. (default: false)
-c --center Centers the window. (default: false, overrides x and y)
-m --monitor MONITOR Try to display on monitor number supplied. Monitor
numbers are starting from 0. (default: 0)
-p --prompt PROMPT Prompt to be displayed to the left of the input field.
(default: None)
-x POSITION X position of the window. (default: 0)
-y POSITION Y position of the window. (default: 0)
-w --width WIDTH Width of the window. (default: screen width)
--font-size FONT_SIZE Font size of the prompt and input. (default: 16px)
-v --vertical Vertical menu. (default: false)
--border-width WIDTH Border width of the menu. (default: 0)
--persist Don't exit when the window loses focus. (default: false)
Behaviour:
The menu will be read from STDIN as newline separated strings. Order is preserved.
If the user input is a match for an option and the user has not selected an
option, the first matching option is printed to stdout and the program
exits with code 0.
If the user input is not a match for an option, the user input is printed
to stdout and the program exits with code 2.
If the user input is empty, nothing is printed and the program exits with
code 0.
If the user presses ESC, the program exits with code 0.
Pressing and holding ALT whilst running will show shortcuts.
None
You will need Raylib library installed on your system to be able to build cmenu. You can try running
make install-depsTo install raylib.
$ git submodule init$ makeThe output binaries will be in the target/ directory.
All in one build and run:
$ make clean && make && ./build/target/cmenu <tests/basic.txtThere is support for memory leak testing described in DEBUG.md
- Support mouse click
- Allow custom font
- Enable custom colours
- Create test suite
- Write launcher script (as per
dmenu_run) - set up companion shell menu script (use
bmenuformat?) - Build for windows (?)
- Add timing reporting for first render
- Add shortcut instructions to readme
- Configurable shortcuts (eg IJKLM instead of UP/DOWN or different shortcut key)
- Capture keystrokes before they get to the input field (eg shortcuts)
- Add number shortcuts option
- Fix arrow navigation and item selection highlight
- Compress raw fonts and assets (using LZ4? Zstd?)
- Set up valgrind check
- Exit on lose focus by default, with option to prevent
- enable vertical mode
- Enable center of screen mode with vertical
- Fix ugly font
- Fix styling with input box
- https://github.com/muff1nman/dmenu2
- https://github.com/davatorium/rofi
- https://github.com/emgram769/lighthouse
- https://github.com/MarkHedleyJones/dmenu-extended
- https://github.com/TrilbyWhite/interrobang
- https://github.com/sbstnc/dmenu-ee
- https://ulauncher.io/
- https://github.com/Cloudef/bemenu
- https://github.com/albertlauncher
See https://thoughtbot.com/blog/the-magic-behind-configure-make-make-install
Setting up CI: https://blog.reds.ch/?p=1956 See also https://github.com/nektos/act for local testing