You are not logged in.
ive been searching all over but i cant find anything about how to do this
i figured someone here must know
also is there a way to do it without root password?
Offline
There's a way, but it's far more useful to do it with a password.
Install gksu, then use the command "gksudo shutdown -h now" or -r for reboot. This will give you a little popup menu for you tou put your password in. That way you don't accidentally hit reboot and lose everything.
And in the midst of such perfection,
I can't help but feel diseased.
Offline
yea, i already tried that but it doesn't work
nothing at all happens when i click it
here is what it looks like
[exec] (Shutdown) {gksu shutdown -h now}
i also tried sudo shutdown -h now but still nothing happens
also gksu is installed and works fine for everything else
Last edited by tjwoosta (2009-04-14 04:09:37)
Offline
Yes, i found a method for this (with menu dialog and all xD):
1° Add your user to sudoers with full permissions for shutdown, reboot, and halt commands. In terminal, type:
su
visudo
and add these lines:
your_user ALL=(ALL) NOPASSWD:/sbin/shutdown
your_user ALL=(ALL) NOPASSWD:/sbin/halt
your_user ALL=(ALL) NOPASSWD:/sbin/reboot
write and save.
2° I use a menu dialog, make with zenity, look like this:
http://img4.imageshack.us/img4/6530/screenshotgcr.png
The scripr, called "logout.sh":
# Filename: logout.sh
# Purpose: Simple logout script using zenity
# Authors: OU812 and anticapitalista for antiX
# Latest change: Sun April 13, 2008.
################################################################################
#!/bin/sh
ans=$(zenity --width=40 --height=200 --title="Salir" --list --text "¿Qué deseas hacer?" --radiolist --column "Elige" --column "Acción" TRUE Logout FALSE Reiniciar FALSE Apagar); #echo $ans
if [ "$ans" = "Logout" ] ; then
kill -TERM $(xprop -root _BLACKBOX_PID | awk '{print $3}')
fi
if [ "$ans" = "Reiniciar" ]; then
sudo reboot
fi
if [ "$ans" = "Apagar" ]; then
sudo halt
fi
change permission and copy to /usr/bin, and add a fluxbox menu entry for this script You need install zenitiy libraries and thar's all.
Edit: I copy and translate this script from AntiX distro
Last edited by superchango (2009-04-14 04:17:42)
"Yo creo que los muertos son tiernos. ¿Nos besamos?"
Offline
yea, i already tried that but it doesn't work
nothing at all happens when i click it
here is what it looks like
[exec] (Shutdown) {gksu shutdown -h now}
i also tried sudo shutdown -h now but still nothing happens
also gksu is installed and works fine for everything else
Then maybe you're having the same issue I had with my Compiz menu, in which case just make a script called shutdown.sh and put the following in there:
#!/bin/bash
gksudo 'shutdown -h now'
Then just put "./shutdown.sh" in the flux menu.
And in the midst of such perfection,
I can't help but feel diseased.
Offline
tjwoosta wrote:yea, i already tried that but it doesn't work
nothing at all happens when i click it
here is what it looks like
[exec] (Shutdown) {gksu shutdown -h now}
i also tried sudo shutdown -h now but still nothing happens
also gksu is installed and works fine for everything else
Then maybe you're having the same issue I had with my Compiz menu, in which case just make a script called shutdown.sh and put the following in there:
#!/bin/bash gksudo 'shutdown -h now'
Then just put "./shutdown.sh" in the flux menu.
i actually tried that already too but it also wouldnt work
anyway i figured out how to do it
just add theese lines to sudoers like superchango said
your_user ALL=(ALL) NOPASSWD:/sbin/shutdown
your_user ALL=(ALL) NOPASSWD:/sbin/halt
your_user ALL=(ALL) NOPASSWD:/sbin/reboot
then use sudo halt in your menu or use superchango's script, or a custom sctipt or whatever)
thanks for all your help guys
Last edited by tjwoosta (2009-04-14 04:40:42)
Offline
i use shutdown-dialog
Offline
I think you can bypass all of tat and just change this in your .xinitrc:
exec ck-launch-session startfluxbox
Offline