Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.25 KB

Zenity.md

File metadata and controls

48 lines (35 loc) · 1.25 KB

Zenity is a GTK+ powered alternative for the dialog(1) and the whiptail(1).

It can display

  • text or password entry
  • calendar (date selector)
  • file/directory selector
  • color chooser
  • confirmation
  • "info"
  • "warning"
  • ...

User input Zenity dumps to STDOUT so you can easily integrate any dialog into your shell scripts.

Also, Zenity can show the desktop notifications and the progress indicators.

Examples

  • OS Suspend confirmation:

    if zenity --question --text="Suspend?" --default-cancel; then
        systemctl suspend
    fi
  • A shopping list (from man zenity):

    zenity --list --checklist --column "Buy" --column "Item" \
        TRUE Apples \
        TRUE Oranges \
        FALSE Pears \
        FALSE Toothpaste
  • A notification (from man zenity):

    zenity --notification --window-icon=update.png --text "System update necessary!"

Wrappers

There are many wrappers for the different programming languages. Here is a couple of them: