I'm using acpid, and I want to know what to put in my /etc/acpi/handler.sh if I want to shutdown -h now the laptop when power button is pressed. I want to do this as user, not as root.
I think I must permit users to use shutdown command, but don't know how to do that (User already belongs to Power group)
Thanks in advance
# gpasswd -a username power
That should be all you need to allow users to shutdown... at least for GNOME and KDE.
Also, depending on your DE, you can easily configure your notebook to poweroff when then power button is pushed. For example, GNOME users can just go to:
System -> Preferences -> Power Management -> General -> Buttons -> Shutdown
Last edited by thayer.w (2007-07-06 17:28:51)
thayer williams ~ cinderwick.ca
In fact I'm using Fluxbox. And I start it with startx command. When I close it, X closes. I don't want to be able to shutdown the laptop with Fluxbox running. I think it's more secure to close X session, then to shutdown..
And I really want to use the power button (I used to do that with Gentoo and acpid)
Ok.. i'm going to try acer_acpi...
Ok I can't use acer_acpi since it conflicts with acerhk (and I absolutely need this to make my multimedia work)
So, I saw there were several acpi* packages, and I don't know which one to use, when I press the power button as user, it does -> sudo halt
acpi ? acpid ? acpi-tools ?
Check this wiki page : http://wiki.archlinux.org/index.php/Shu … wer_button
If you want to disable this function when running a wm/de , you'll have to write your own action script to take care of this.
Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them
I use xbindkeys with the following action set up:
# Stand-by/Shut Down key (Sleep) "/opt/kde/bin/dcop --all-users --all-sessions ksmserver ksmserver logout 0 2 0" m:0x0 + c:223
When I press the button it shuts down the system at once. Clean and effective.
BTW, m:0x0 + c:223 makes reference to the (Sleep) button in my machine. In your machine the code may be different and you should use the xbindkeys tools to find the correct code for you computer.
Hope this helps.
Ok thanks for your answers
LoneWolf: I didn't see this Wiki page ! I will try this
ralvez: I changed Fluxbox (when I wrote this topic) to Openbox. Anyway, I want to be able to shutdown the computer when X is closed (under console) My power button keycode is 222 according xev... I will see how I can try to combine the keycode with /etc/acpi/events/power and I give a feedback as soon as I managed ...