Explore zenity
zenity:
Zenity is an open source and a cross-platform application which displays GTK+ Dialog Boxes in command-line and using shell scripts. It allows to ask and present information to/from shell in Graphical Boxes. The application lets you create Graphical dialog boxes in command-line and makes the interaction between user and shell very easy.
we can use zenity to create simple dialog that interact graphically with the user.
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.
Zenity Features:
- FOSS Software
- Cross Platform Application
- Allow GTK+ Dialog Box Execution
- Command Line Tool
- Support in Shell Scripting
Usefulness:
- Easy GUI Creation
- Less features than other complex Tools
- Enables shell scripts to interact with a GUI users
- Simple dialog creation is possible for graphical user interaction
zeinty Manual:
>_ man zenity
OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes
(`-’).
Dialog options
— calendar
Display calendar dialog
— entry
Display text entry dialog
— error
Display error dialog
— file-selection
Display file selection dialog
— info Display info dialog
— list Display list dialog
etc etc……………………………
Examples:
>_ zenity — — calendar
>_ zenity — question — title “Alert” — text “Can we proceed?”
ode will be 0 (true in shell) if OK is selected, and 1
(false) if Cancel is selected.
>_ zenity — list — checklist — column “Pragrming” — column “Language” TRUE Python TRUE Java FALSE c FALSE c++ TRUE Dart
>_ zenity — notification — window-icon=update.png — text “System update necessary!”
>_ find $HOME -name ‘*.ps’ | zenity — progress — pulsate
>_ zenity — notification — text=”$($(zenity — entry))”
By this command we can give linux command in entry box and the command output will show in notification.
And a lot of GTK. Graphical dialog can be build using zenity. For all knowledge take a read of zenity manual.