| Crates.io | zenity-rs |
| lib.rs | zenity-rs |
| version | 0.1.8 |
| created_at | 2026-01-18 18:12:53.345555+00 |
| updated_at | 2026-01-23 18:31:21.141912+00 |
| description | Display simple GUI dialogs from the command line |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2052787 |
| size | 437,652 |
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.
cargo install zenity-rs
Or build from source:
git clone https://github.com/user/zenity-rs
cd zenity-rs
cargo build --release
# Information dialog
zenity-rs --info --text="Operation completed successfully"
# Warning dialog
zenity-rs --warning --text="This action cannot be undone"
# Error dialog
zenity-rs --error --text="Failed to save file"
# Question dialog (Yes/No)
zenity-rs --question --text="Do you want to continue?"
# Text entry
zenity-rs --entry --text="Enter your name:" --entry-text="Default"
# Password input
zenity-rs --password --text="Enter password:"
# Static progress
zenity-rs --progress --text="Processing..." --percentage=50
# Pulsating progress
zenity-rs --progress --text="Please wait..." --pulsate
# Controlled via stdin
(
echo "10"
sleep 1
echo "50"
sleep 1
echo "100"
) | zenity-rs --progress --text="Working..." --auto-close
# Open file
zenity-rs --file-selection --title="Select a file"
# Save file
zenity-rs --file-selection --save --filename="output.txt"
# Select directory
zenity-rs --file-selection --directory
# Simple list
zenity-rs --list --column="Name" --column="Size" file1 10KB file2 20KB
# Checklist (multi-select)
zenity-rs --list --checklist --column="Select" --column="Item" FALSE "Option A" TRUE "Option B"
# Radiolist (single-select)
zenity-rs --list --radiolist --column="Select" --column="Item" FALSE "Option A" TRUE "Option B"
# Date picker
zenity-rs --calendar --text="Select a date"
# With initial date
zenity-rs --calendar --year=2024 --month=12 --day=25
# Display file contents
zenity-rs --text-info --filename=README.md --title="Read Me"
# Display from stdin
cat LICENSE | zenity-rs --text-info --title="License"
# With checkbox (for agreements)
zenity-rs --text-info --filename=LICENSE --checkbox="I accept the terms"
# Basic slider
zenity-rs --scale --text="Select volume:"
# With custom range and initial value
zenity-rs --scale --text="Brightness:" --value=75 --min-value=0 --max-value=100
# With step increment
zenity-rs --scale --text="Select:" --min-value=0 --max-value=1000 --step=10
# Hide the value display
zenity-rs --scale --text="Level:" --hide-value
# Multiple text fields
zenity-rs --forms --text="Enter details:" --add-entry="Name" --add-entry="Email"
# With password field
zenity-rs --forms --text="Login:" --add-entry="Username" --add-password="Password"
# Custom separator (default is |)
zenity-rs --forms --add-entry="First" --add-entry="Last" --separator=","
--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
| 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 |
cargo build --release
cargo build --release --no-default-features --features x11
cargo build --release --no-default-features --features wayland
cargo build --release --target x86_64-unknown-linux-musl
MIT