A fast Wayland application launcher with fuzzy search and vim-style navigation.
  • C 96.8%
  • CMake 3.2%
Find a file
Sandro Alves a278a89a09 merge: zmcp-integration — automation flags
--version/--print/--prompt/--prefill/--timeout/--auto-index, distinct exit
codes (0/1/2), getline() dmenu items, ~/.config/zmenu/config.toml themes with
--theme overrides. All additive; README updated.
2026-10-17 11:03:56 +01:00
include feat(automation): --prefill, --timeout/--auto-index, config file + --theme 2026-10-17 04:04:38 +01:00
protocols feat: Implement initial ZMenu application with Wayland layer shell integration and core components 2026-02-04 03:28:50 +00:00
src feat(automation): --prefill, --timeout/--auto-index, config file + --theme 2026-10-17 04:04:38 +01:00
.gitignore feat(automation): --version, --print, --prompt, exit codes, getline items 2026-10-17 03:41:30 +01:00
CMakeLists.txt feat: Implement initial ZMenu application with Wayland layer shell integration and core components 2026-02-04 03:28:50 +00:00
LICENSE fix: Prevent recursive menu opening by filtering 'menu' entries in app listing and add project license and README. 2026-02-04 10:24:53 +00:00
README.md feat(automation): --prefill, --timeout/--auto-index, config file + --theme 2026-10-17 04:04:38 +01:00

ZMenu

A fast, minimal menu application for the Zurin Wayland compositor.

Features

  • Zurin Integration - Shows apps from Zurin config by default
  • TOML Menus - Custom menus in ~/.config/zmenu/custom/
  • JSON Support - Dynamic menus via command-line arguments
  • dmenu Mode - Read items from stdin
  • Fuzzy Filtering - Type to filter, scored by prefix/substring match
  • Keyboard Navigation - vim-style (j/k) and arrow keys

Dependencies

  • wayland-client
  • wayland-protocols
  • xkbcommon

Building

mkdir build && cd build
cmake ..
make -j$(nproc)
sudo make install

Usage

# Show Zurin configured apps (default)
zmenu

# Load custom TOML menu
zmenu --menu ~/.config/zmenu/custom/apps.toml

# Load from JSON
zmenu --json '{"items":[{"name":"Firefox","command":"firefox"}]}'

Automation flags (for scripts and the zmcp MCP server)

# Print the selected item instead of executing it (default: command)
zmenu --json '{"items":[{"name":"Editor","command":"code"}]}' --print
zmenu --menu ~/.config/zmenu/custom/apps.toml --print name

# Custom input prompt
zmenu --dmenu --prompt "Pick a workspace: "

# Start with a filter applied
zmenu --dmenu --prefill "fire"

# Non-interactive automation: close after 5 s, selecting the second item
zmenu --dmenu --timeout 5000 --auto-index 1

# Version probe
zmenu --version

--print also works with the default Zurin-apps source (prints the app name without opening it). --dmenu already prints the selection to stdout. --timeout without --auto-index behaves like Escape (cancel, exit 1).

Theming

Appearance defaults live in config_load_defaults; override them with --theme <path> or a per-user file at ~/.config/zmenu/config.toml (loaded automatically when present; --theme wins):

[appearance]
bg_color = "#1e1e2e"          # #RRGGBB or #AARRGGBB
fg_color = "#cdd6f4"
sel_bg_color = "#45475a"
sel_fg_color = "#f5e0dc"
border_color = "#89b4fa"
input_bg_color = "#313244"
font_size = 16
width = 600
max_lines = 10
padding = 8
border_width = 2
prompt = "> "

Exit codes

Code Meaning
0 Item selected (printed or executed)
1 Cancelled (Escape)
2 Error (bad arguments, parse/load failure, no items, display init)

TOML Menu Format

[[menu]]
name = "Firefox"
command = "firefox"

[[menu]]
name = "Terminal"
command = "kitty"

Zurin Integration

Add to ~/.config/zurin/config.toml:

[apps]
menu = "zmenu"

Keyboard Controls

Key Action
↑/↓ or j/k Navigate items
Enter Select
Escape Cancel
Tab/Shift+Tab Next/Previous
Backspace Delete character
Typing Filter items

License

GNU General Public License v3.0 - see LICENSE