Zenity displays GUI dialogs on linux with examples
Written By Smart|
10 August 2009|
3 Comments
Zenity is a program that allows the execution of GTK+ dialog boxes in command-line and shell scripts.
Zenity manual :
Zenity information dailog box.Using this box you need display information.
For example :
code:
$zenity --info --text "hello World"
Output :
zenity warning box
code:
$zenity --warning --text "you are running out of disk"
output :
Zenity notification box
code:
$zenity --notification --text "You need to update"
output:
Zenity List box
code :
$ zenity --list \
--title="Choose the greeting to display" \
--column="number" --column="Timming" --column="Greeting" \
1 Morning "Good morning" \
2 Afternoon "Good Afternoon" \
3 Evening "Good evening" \
output :
Zenity File selection box
With this you can select a file
code:
$zenity --file-selection --title="Browse a File"
Zenity process dialog box
code
$( echo "10" ; sleep 1
echo "20" ; sleep 1
echo "50" ; sleep 1
) |
zenity --progress \
--title="porcess dispaly" \
--text="processing going..." \
--percentage=0
output :









I have created a shell script using Zenity to display an Acceptable Use Policy, (closes box), (Cancel or close box) will logout user…
… But I was wondering (how|if) you can modify for preset image in dialog box be replaced by a custom image? For example, logo of company enforcing that Acceptable Use Policy?
Any suggestions would be greatly appreciated…
Hi,
Yes i can do it .can you send me that script.so that i can go thu it first and revert back to you with solution.
mail me : admin@smartproteam.com
Thanx
admin
Hi,
First I would like to thank him for about zenity magnificent document, it was very useful to me in my introductory studies.
Now I’m have one problem and would like to share it with you.
I create a table, to read the value of one variable, and put on a multiple rows, like your example timming, greeting.
s1=220
s1_ex=-100
s1_resp=”pass”
zenity –list –multiple –text “result of analyse” –column parametro –column “expected value” –column “measured value” –column “Result” S1_PARAM “$s11_ex” “$s1″ “$s1_resp”
the scrip above works with positive values(like s1_ex=100), is how to work with negative values for s1?
Any suggestions would be greatly appreciated…
thank you so much
Leave your response!
Subscribe to Smartproteam
Subscribe to RSS Feeds
Translator
Ads
Recent Posts
Most Commented
Most Viewed