052-055 Zenity
052-055 Zenity
052-055 Zenity
SHELL CLICK
www.sxc.hu
Zenity and KDialog let you integrate your scripts with the native KDE or
01 #!/bin/sh
02 zenity scale
52
ISSUE 99
FEBRuaRy 2009
Know-How
kdialog yesno
"Show Directory"
list column
FEBRuary2009
ISSUE 99
53
KnOw-HOw
rememberfile:decision
yesno "Do you really
want to delete this
U
U
file?"
The rememberfile:
you should restrict the users selection options.
decision entry makes
sure that the dialog really does remem[Notification Messages]
ber your decision. KDialog creates a file
decision=yes
called rememberfile below ~/.kde/
share/config/ and stores your decision in
In this case, the script would autorethe decision variable as the following
spond Yes whenever this question is
test shows:
posed.
KDialog dialog boxes typically have a
couple more switches that Ill look at. If
$ cat ~/.kde/share/ U
you get stuck, man kdialog and the overconfig/rememberfile
--question
--progress
--notification
--calendar
--info
--warning
--scale
--error
--entry
--list
54
ISSUE 99
--text-info
FEBRuaRy 2009
--file-selection
KnOw-HOw
Conclusions
INFO
If you author scripts for other users, dialog boxes give them useful visual feedback especially if they are newcomers.
Finally, a word of warning: Dont be
surprised if you find yourself re-writing
working scripts and get so used to the
--msgbox
--warningyesno
--textbox
--progressbar
--inputbox
--getexistingdirectory
--combobox
--warningcontinuecancel
--menu
--passivepopup
--warningyesnocancel
--checklist
--getopenfilename
--sorry
--error
--yesno
--radiolist
--getsavefilename
--yesnocancel
FEBRuaRy 2009
ISSUE 99
55