LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   xdialog/fluxbox issue (https://www.linuxquestions.org/questions/linux-software-2/xdialog-fluxbox-issue-266720/)

YBA^[x] 12-15-2004 11:55 AM

xdialog/fluxbox issue
 
Hey.

Based on code from another thread I've made this:

Code:

#!/bin/sh
DIALOG=Xdialog
 
$DIALOG --title "Logout options" \
        --menu "choose:" 0 0 3\
        "reboot" "Reboot the box" \
        "poweroff" "Shut down the box" 2>/tmp/logoutbox.tmp.$$
 
retval=$?
choice=`cat /tmp/logoutbox.tmp.$$`
rm -f /tmp/logoutbox.tmp.$$
 
case $retval in
  0)
    $choice ;;
  1)
    echo "Cancel pressed.";;
  255)
    echo "Box closed.";;
esac

When running it from xterm it works just fine, reboot and poweroff is all dandy, but not when running it from the fluxbox menu. I get a dialog box, but for some reason it doesn't poweroff or reboot. The menu entry is like this:

Code:

[exec] (Logout) {./logoutbox.sh}
When exiting X I can see an error message close to this; reboot: command not found
Same with poweroff. I am certain that they exist since I can issue them from xterm. Any ideas?
Btw, Im using Fluxbox 0.9.10 on Slackware 10.

Regards.

sigsegv 12-15-2004 01:15 PM

Use the full paths to reboot and poweroff

YBA^[x] 12-15-2004 01:44 PM

Thanks. As in /sbin/reboot? If so, it doesn't really change much. I get a "no such file or folder" error. Issueing /sbin/reboot from xterm works fine, though....

EDIT:

My bad. Is was caused by a typo. Thanks a lot. :)


All times are GMT -5. The time now is 05:21 AM.