I have several Zenity + scripts that I use for specific 'root' jobs that would normally be done on the command line with sudo. But ...
N.B.
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:
#! /bin/bash
# Open Emacs as root at / directory
# file name: RootEmacs
sudo -K
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"
exit 1
fi
# End
I launch RootEmacs from a desktop (or panel) launcher (icon). It is great for checking or changing configuration files on the fly.
Discussion on:
- Keyboard Shortcuts:
- Prev
- Next
- Toggle

































