Button/power: acpid/GNOME/FC5

wwp subscript at free.fr
Wed May 3 14:19:16 UTC 2006


Hello Aaron,


On Wed, 03 May 2006 09:06:18 -0500 Aaron Konstam <akonstam at sbcglobal.net> wrote:

> On Wed, 2006-05-03 at 09:47 +0200, wwp wrote:
> > Hey all,
> > 
> > 
> > I've recently setup acpid on my FC5 to execute a script when the
> > button/power is pressed. I did that using /etc/acpi/ files, as I did
> > previously for the lid events and so on.
> > 
> > The funny thing is that it worked. Why funny? 'cause usually on the FC5
> > GNOME desktop, pressing the power button raises a "Are you sure you want
> > to log out" GNOME dialog, w/ logout/shutdown/restart buttons.
> What script do you run when the button is pressed. It seems to me the
> standard one of /sbin/shutdown would not deal with any Gnome dialog.
[snip]

My /etc/acpi/events/hibernate.conf:

event=button/power
action=/etc/acpi/actions/hibernate.sh


My /etc/acpi/actions/hibernate.sh:

#!/bin/sh
/usr/local/bin/gxmessage -center -wrap -name "Hibernate" -title "Hibernate" -buttons "OK:0,Cancel:1" -default "Cancel" "Suspend to disk now?" && \
        /usr/sbin/pm-hibernate
exit $?

Of course it's just a call to pm-hibernate from the pm-utils-0.15-1 package,
I just added a dialog to ask for confirmation.

FYI, I use pm-utils to hibernate for weeks w/o any problem.


But take care, maybe I wasn't precise enough: when the GNOME shutdown dialog
stopped working (why?), I implemented my own hook for the power button (the
attached script, thru acpid). Now that the GNOME shutdown dialog is back
(why?), my custom stuff doesn't work anymore (I don't care, I succeeded in
hibernating from the Fn+Hibernate button of my laptop).


Regards,

-- 
wwp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20060503/b2fa7152/attachment-0001.sig>


More information about the fedora-list mailing list