Ask user to confirm

Jack Coates jack at
Mon Jan 19 17:04:46 CET 2004

On Mon, 2004-01-19 at 01:32, Matthias Fechner wrote:
> Hi,
> if i write my own menu.xml, whould it be possible the display a box,
> on which the user can confirm or decline something, e.g.
> <menu name="Shutdown" cmd="sudo halt">
> If the user click on Shutdown, he will be asked if he is sure.
> Thanks for any hints.

[jack at chupacabra jack]$ cat /usr/local/sbin/halt-dialog 

export DISPLAY=":0.0"
RESULTS=`Xdialog --screen-center --default-no --yesno "The system is
about to shut down, do you want to continue?" 10 50`
case $EXIT_CODE in
        0) /sbin/halt
        1) exit
        255) exit

Jack at Monkeynoodle Dot Org: It's A Scientific Venture...
* "Brainiac's daughter made me a suit of bricks and mortar and a     *
* matching stove pipe hat, oh yes, Brainiac's daughter took me on a  *
* sleigh ride underwater and I'm crazy for girls like that."         *
* -- Brainiac's Daughter from Chips From The Chocolate Fireball by   *
* The Dukes of Stratosphear                                          *

More information about the Xfce mailing list