From 8571c78816bf5d9cb258ead69f5edcb20fa48523 Mon Sep 17 00:00:00 2001 From: Thomas Barusseau Date: Thu, 30 Nov 2017 04:28:10 +0100 Subject: [PATCH] zenity: add page (#1687) --- pages/linux/zenity.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pages/linux/zenity.md diff --git a/pages/linux/zenity.md b/pages/linux/zenity.md new file mode 100644 index 0000000000..fe81f8db04 --- /dev/null +++ b/pages/linux/zenity.md @@ -0,0 +1,24 @@ +# zenity + +> Display dialogs from the command line/shell scripts. +> Return user-inserted values or 1 if error. + +- Display the default question dialog: + +`zenity --question` + +- Display an info dialog displaying the text "Hello!": + +`zenity --info --text="{{Hello!}}"` + +- Display a name/password form and output the data separated by ";": + +`zenity --forms --add-entry="{{Name}}" --add-password="{{Password}}" --separator="{{;}}"` + +- Display a file selection form in which the user can only select directories: + +`zenity --file-selection --directory` + +- Display a progress bar which updates its message every second and show a progress percent: + +`{{(echo "#1"; sleep 1; echo "50"; echo "#2"; sleep 1; echo "100")}} | zenity --progress`