zenity command examples

zenity command examples

zenity – display GTK+ dialogs

Display a file selector with the title Select a file to remove. The file selected is returned on standard output.

zenity --title="Select a file to remove" --file-selection

Display a text entry dialog with the title Select Host and the text Select the host you would like to flood-ping. The entered text is returned on standard output.

zenity --title "Select Host" --entry --text "Select the host you would like to flood-ping"

Display a dialog, asking Microsoft Windows has been found! Would you like to remove it?. The return code will be 0 (true in shell) if OK is selected, and 1 (false) if Cancel is selected.

zenity --question --title "Alert" --text "Microsoft Windows has been found! Would you like to remove it?"

Show the search results in a list dialog with the title Search Results and the text Finding all header files….

find . -name '*.h' | zenity --list --title "Search Results" --text "Finding all header files.." --column "Files"

Show a notification in the message tray

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

Display a weekly shopping list in a check list dialog with Apples and Oranges pre selected

zenity --list --checklist --column "Buy" --column "Item" TRUE Apples TRUE Oranges FALSE Pears FALSE Tooth‐paste

Display a progress dialog while searching for all the postscript files in your home directory

find $HOME -name '*.ps' | zenity --progress --pulsate

Leave a Reply

Your email address will not be published. Required fields are marked *