zenity-rs
A lightweight, pure Rust implementation for displaying GUI dialogs from the command line. Designed for shell scripts and CLI tools that need simple user interaction.
Features
- Message dialogs: Info, warning, error, and question dialogs
- Input dialogs: Text entry and password input
- Progress dialog: With stdin control and pulsating mode
- File selection: Open/save dialogs with directory navigation
- List selection: Single-select, checklist, and radiolist modes
- Calendar: Date picker dialog
- Text info: Display scrollable text from file or stdin
- Scale: Slider to select a numeric value
- Forms: Multiple input fields in a single dialog
Highlights
- Pure Rust with no GTK/Qt dependencies
- Native X11 and Wayland support
- Small static binary (~1.5MB with musl)
- Automatic theme detection (light/dark)
- Respects system keyboard layout
Installation
Or build from source:
Usage
Message Dialogs
# Information dialog
# Warning dialog
# Error dialog
# Question dialog (Yes/No)
Input Dialogs
# Text entry
# Password input
Progress Dialog
# Static progress
# Pulsating progress
# Controlled via stdin
(
) |
File Selection
# Open file
# Save file
# Select directory
List Selection
# Simple list
# Checklist (multi-select)
# Radiolist (single-select)
Calendar
# Date picker
# With initial date
Text Info
# Display file contents
# Display from stdin
|
# With checkbox (for agreements)
Scale
# Basic slider
# With custom range and initial value
# With step increment
# Hide the value display
Forms
# Multiple text fields
# With password field
# Custom separator (default is |)
Common Options
--title=TEXT # Set dialog title
--text=TEXT # Set dialog text/prompt
--width=N # Set dialog width
--height=N # Set dialog height
--timeout=N # Auto-close after N seconds
Exit Codes
| Code | Meaning |
|---|---|
| 0 | OK/Yes clicked, or selection made |
| 1 | Cancel/No clicked |
| 5 | Timeout reached |
| 255 | Dialog was closed (ESC or window close) |
| 100 | Error occurred |
Building
Default (X11 + Wayland)
X11 only
Wayland only
Static binary (musl)
License
MIT