I have several Zenity + scripts that I use for specific 'root' jobs that would normally be done on the command line with sudo. But ...
To get zenity and sudo to cooperate you first must comment out the /etc/sudoers default
## Defaults requiretty
Once that is done sudo as part of a Zenity script will work. The following is an example of a simple script:
# Open Emacs as root at / directory
# file name: RootEmacs
zenity --entry \
--title="Write root files" \
--text="Enter your user _password:" \
--entry-text "" \
--hide-text |sudo -S emacs --no-splash /
if [ "$?" != 0 ]; then
zenity --error --text="Sorry, wrong password"
I launch RootEmacs from a desktop (or panel) launcher (icon). It is great for checking or changing configuration files on the fly.
cool... I used zenity to catalogue some files on my system. Thanks for the post.
- Keyboard Shortcuts: