zenity - Man Page

manual page for zenity 4.0.3

Examples (TL;DR)

Description

zenity is a program that will display GTK+ dialogs, and return (either in the return code, or on standard output) the users input. This allows you to present information, and ask for information from the user, from all manner of shell scripts.

For example, zenity --question will return either 0, 1 or 5, depending on whether the user pressed OK, Cancel or timeout has been reached. zenity --entry will output on standard output what the user typed into the text entry field.

Comprehensive documentation is also available in the GNOME Help Browser.

Usage

zenity [OPTIONâ.¦]

Help Options

-h,  --help

Show help options

--help-all

Show all help options

--help-general

Show general options

--help-calendar

Show calendar options

--help-entry

Show text entry options

--help-error

Show error options

--help-info

Show info options

--help-file-selection

Show file selection options

--help-list

Show list options

--help-notification

Show notification options

--help-progress

Show progress options

--help-question

Show question options

--help-warning

Show warning options

--help-scale

Show scale options

--help-text-info

Show text information options

--help-color-selection

Show color selection options

--help-password

Show password dialog options

--help-forms

Show forms dialog options

--help-misc

Show miscellaneous options

General options

--title=TITLE

Set the dialog title

--width=WIDTH

Set the width

--height=HEIGHT

Set the height

--timeout=TIMEOUT

Set dialog timeout in seconds

--ok-label=TEXT

Set the label of the OK button

--cancel-label=TEXT

Set the label of the Cancel button

--extra-button=TEXT

Add an extra button

--modal

Set the modal hint

--attach=WINDOW

DEPRECATED; does nothing

Calendar options

--text=TEXT

Set the dialog text

--day=DAY

Set the calendar day

--month=MONTH

Set the calendar month

--year=YEAR

Set the calendar year

--date-format=PATTERN

Set the format for the returned date

Text entry options

--text=TEXT

Set the dialog text

--entry-text=TEXT

Set the entry text

--hide-text

Hide the entry text

Error options

--text=TEXT

Set the dialog text

--icon=ICON-NAME

Set the icon name

--no-wrap

Do not enable text wrapping

--no-markup

Do not enable Pango markup

--ellipsize

Enable ellipsizing in the dialog text. This fixes the high window size with long texts

Info options

--text=TEXT

Set the dialog text

--icon=ICON-NAME

Set the icon name

--no-wrap

Do not enable text wrapping

--no-markup

Do not enable Pango markup

--ellipsize

Enable ellipsizing in the dialog text. This fixes the high window size with long texts

File selection options

--filename=FILENAME

Set the filename

--multiple

Allow multiple files to be selected

--directory

Activate directory-only selection

--save

Activate save mode

--separator=SEPARATOR

Set output separator character

--file-filter=NAME | PATTERN1 PATTERN2 ...

Set a filename filter

--confirm-overwrite

DEPRECATED; does nothing

List options

--text=TEXT

Set the dialog text

--column=COLUMN

Set the column header

--checklist

Use check boxes for the first column

--radiolist

Use radio buttons for the first column

--imagelist

Use an image for the first column

--separator=SEPARATOR

Set output separator character

--multiple

Allow multiple rows to be selected

--editable

Allow changes to text

--print-column=NUMBER

Print a specific column (Default is 1. 'ALL' can be used to print all columns)

--hide-column=NUMBER

Hide a specific column

--hide-header

Hide the column headers

--mid-search

DEPRECATED; does nothing

Notification options

--text=TEXT

Set the notification text

--icon=ICON-NAME

Set the icon name

--listen

Listen for commands on stdin

--hint=TEXT

DEPRECATED; does nothing

Progress options

--text=TEXT

Set the dialog text

--percentage=PERCENTAGE

Set initial percentage

--pulsate

Pulsate progress bar

--auto-close

Dismiss the dialog when 100% has been reached

--auto-kill

Kill parent process if Cancel button is pressed

--no-cancel

Hide Cancel button

--time-remaining

Estimate when progress will reach 100%

Question options

--text=TEXT

Set the dialog text

--icon=ICON-NAME

Set the icon name

--no-wrap

Do not enable text wrapping

--no-markup

Do not enable Pango markup

--default-cancel

Give Cancel button focus by default

--ellipsize

Enable ellipsizing in the dialog text. This fixes the high window size with long texts

--switch

Suppress OK and Cancel buttons

Warning options

--text=TEXT

Set the dialog text

--icon=ICON-NAME

Set the icon name

--no-wrap

Do not enable text wrapping

--no-markup

Do not enable Pango markup

--ellipsize

Enable ellipsizing in the dialog text. This fixes the high window size with long texts

Scale options

--text=TEXT

Set the dialog text

--value=VALUE

Set initial value

--min-value=VALUE

Set minimum value

--max-value=VALUE

Set maximum value

--step=VALUE

Set step size

--print-partial

Print partial values

--hide-value

Hide value

Text information options

--filename=FILENAME

Open file

--editable

Allow changes to text

--font=TEXT

Set the text font

--checkbox=TEXT

Enable an I read and agree checkbox

--auto-scroll

Auto scroll the text to the end. Only when text is captured from stdin

Color selection options

--color=VALUE

Set the color

--show-palette

Show the palette

Password dialog options

--username

Display the username option

Forms dialog options

--add-entry=Field name

Add a new Entry in forms dialog

--add-password=Field name

Add a new Password Entry in forms dialog

--add-calendar=Calendar field name

Add a new Calendar in forms dialog

--add-list=List field and header name

Add a new List in forms dialog

--list-values=List of values separated by |

List of values for List

--column-values=List of values separated by |

List of values for columns

--add-combo=Combo box field name

Add a new combo box in forms dialog

--combo-values=List of values separated by |

List of values for combo box

--show-header

Show the columns header

--text=TEXT

Set the dialog text

--separator=SEPARATOR

Set output separator character

--forms-date-format=PATTERN

Set the format for the returned date

Miscellaneous options

--about

About zenity

--version

Print version

Application Options

--calendar

Display calendar dialog

--entry

Display text entry dialog

--error

Display error dialog

--info

Display info dialog

--file-selection

Display file selection dialog

--list

Display list dialog

--notification

Display notification

--progress

Display progress indication dialog

--question

Display question dialog

--warning

Display warning dialog

--scale

Display scale dialog

--text-info

Display text information dialog

--color-selection

Display color selection dialog

--password

Display password dialog

--forms

Display forms dialog

Examples

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 passive notification

zenity --notification --icon=software-update-available --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 Toothpaste

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

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

Author

Zenity was originally written by Glynn Foster <glynn.foster@sun.com>. It has since been maintained by a number of contributors since then.

This manual page was originally written by Ross Burton <ross@burtonini.com>. It currently contains portions which are automatically generated, and other portions written by its original author.

See Also

dialog(1)

Referenced By

wmctrl(1), yad(1).

October 2024 zenity 4.0.3