Skip to content

hamidzr/gmenu

Repository files navigation

gmenu

A fast, fuzzy menu selector for desktop and terminal environments, inspired by dmenu and rofi.

Features

  • GUI Mode: Desktop interface using Fyne framework
  • Terminal Mode: Command-line interface for headless environments
  • Fuzzy Search: Intelligent matching with sahilm/fuzzy library
  • Configurable: YAML config files, environment variables, and CLI flags
  • Menu State: Caching and persistence of selections
  • Single Instance: Per-menu ID instance enforcement

Installation

From Source

git clone https://github.com/hamidzr/gmenu.git
cd gmenu
just build

The binary will be available at bin/gmenu.

Usage

Basic Usage

# GUI mode (default)
echo -e "option1\noption2\noption3" | gmenu

# Terminal mode
echo -e "option1\noption2\noption3" | gmenu --terminal

Configuration

gmenu uses a hierarchical configuration system:

  1. CLI flags (highest priority)
  2. Environment variables (GMENU_ prefix)
  3. YAML config files (lowest priority)

Config files are located at:

  • ~/.config/gmenu/config.yaml
  • ~/.gmenu/config.yaml

Menu IDs

Use menu IDs to maintain separate state for different use cases:

echo -e "file1\nfile2\nfile3" | gmenu --menu-id files
echo -e "action1\naction2\naction3" | gmenu --menu-id actions

Development

Building

# Build main binary
just build

# Build for multiple platforms
just build-all

# Install dependencies and tools
just setup

# Clean build artifacts
just clean

Testing

# Run all tests
just test

# Run specific tests
go test ./core/...

# Lint code
just lint

# Format code
just fmt

# Run all checks (format, lint, test)
just check

Architecture

  • CLI Layer (internal/cli/): Command-line interface
  • Core (core/): Application logic and menu management
  • Rendering (render/): UI components and theming
  • Configuration (internal/config/, model/): Config management
  • Storage (store/): State persistence

Inspiration

License

[Add your license here]

About

fuzzy GUI menu for the terminal. Inspired by suckless dmenu

Resources

License

Stars

Watchers

Forks