You are not logged in.
Hi,
Will anybody please publish a modified /etc/acpi/handler.sh file where pm-suspend iis called on closing of the lid? I tried snippets found in various places, but no success. Probably because I can't really read bash code...
Offline
this code (from german wiki)executes slock if the lid-button is pressed.
button/lid)
#echo "LID switched!">/dev/tty5
if [ `/bin/awk '{print $2}' /proc/acpi/button/lid/LID/state` == closed ]; then
DISPLAY=:0 su -c - $USER /usr/bin/slock
fi
;;
*)
logger "ACPI group/action undefined: $1 / $2"
;;
replacing the line
DISPLAY=:0 su -c - $USER /usr/bin/slock
with the command for pm-suspend should do it.
p.s.
I don't know much about pm-suspend.
Offline
It's me, your own suspend helper!
I simply have
event=button/lid (LID0)
action=/usr/sbin/pm-suspend
in /etc/acpi/events. If it doesn't work, use acpi_listen to get the name of the event.
Last edited by lucke (2009-05-11 19:31:39)
Offline
It's me, your own suspend helper!
Happy to hear from you again!
I've got this file (/etc/acpi/events/anything):
# Pass all events to our one handler script
event=.*
action=/etc/acpi/handler.sh %e
How exactly am I supposed to modify it? Sorry for a dumb question, by I tread on a totally unfamiliar ground .
UPD:
My acpi_listen output (close/open):
# acpi_listen
button/lid LID 00000080 00000003
video VGA 00000080 00000000
button/lid LID 00000080 00000004
video VGA 00000080 00000000
Last edited by Llama (2009-05-11 19:58:39)
Offline
Just create another file, named e.g. lid, in that dir, and put the contents I provided there, possibly changing (LID0) to (LID). I think you have to /etc/rc.d/acpid restart to make the changes register.
Ku.
Last edited by lucke (2009-05-11 20:05:34)
Offline
Thanks again!
Now I've got two files:
/etc/acpi/events/anything:
# Pass all events to our one handler script
event=.*
action=/etc/acpi/handler.sh %e
/etc/acpi/events/lid:
event=button/lid (LID)
action=/usr/sbin/pm-suspend
Is it just as it's supposed to be? It works, at last, unless I'm overlooking something important ...
Offline
It is how it should be.
Offline
Yes, I did overlook something : first time after reboot it works properly: there's a system sound on closing; on opening I'm presented with the unlock password request. Second time there's no system sound and no password request, though the power LED is slowly blinking red, as on the first time. On the third time in won't suspend at all.
Meanwhile the Sleep button on the Power applet works properly every time.
Last edited by Llama (2009-05-11 20:53:02)
Offline