You are not logged in.

#1 2009-04-14 03:43:29

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

how do i shutdown completely from fluxbox menu?

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

#2 2009-04-14 03:47:26

SomeGuyDude
Member
Registered: 2008-10-09
Posts: 271

Re: how do i shutdown completely from fluxbox menu?

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

#3 2009-04-14 04:06:28

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

Re: how do i shutdown completely from fluxbox menu?

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

#4 2009-04-14 04:14:55

superchango
Member
From: Tenochtitlan
Registered: 2009-01-22
Posts: 133

Re: how do i shutdown completely from fluxbox menu?

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 tongue

Last edited by superchango (2009-04-14 04:17:42)


"Yo creo que los muertos son tiernos. ¿Nos besamos?"

Offline

#5 2009-04-14 04:20:18

SomeGuyDude
Member
Registered: 2008-10-09
Posts: 271

Re: how do i shutdown completely from fluxbox menu?

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.


And in the midst of such perfection,
I can't help but feel diseased.

Offline

#6 2009-04-14 04:37:39

tjwoosta
Member
Registered: 2008-12-18
Posts: 453

Re: how do i shutdown completely from fluxbox menu?

SomeGuyDude wrote:
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

#7 2009-04-14 06:17:52

dunz0r
Member
From: Sweden
Registered: 2009-03-30
Posts: 258
Website

Re: how do i shutdown completely from fluxbox menu?

I'd do this:

[exec] (Shutdown) {xterm -e sudo shutdown -h now}

Last edited by dunz0r (2009-04-14 06:18:12)


RTFM or GTFO
hax0r.se

Offline

#8 2009-04-14 11:00:04

Bert
Member
From: Zwolle
Registered: 2006-04-10
Posts: 14

Re: how do i shutdown completely from fluxbox menu?

Offline

#9 2009-04-14 16:03:20

CaptainShanks
Member
Registered: 2008-10-25
Posts: 57

Re: how do i shutdown completely from fluxbox menu?

I think you can bypass all of tat and just change this in your .xinitrc:

exec ck-launch-session startfluxbox

Offline

Board footer

Powered by FluxBB