You are not logged in.
Pages: 1
According to some stuff I've read, gnome-power-manager and whatnot call pm-suspend via HAL when HAL detects a certain keystroke (e.g. Fn + F4 for Acer laptops). Is it possible to cut out the middleman and configure HAL to automatically invoke things when it detects Fn + F4 or some other keystroke? Can I modify some config file somewhere so that the suspend key actually runs pm-suspend, without bogging myself down configuring acpid?
Offline
I have no idea how to configure it through HAL, but configuring acpid is pretty easy.
All you have to do is an action script, edit event script, and grab FN+F4 code from /var/log/acpid.log
So from the beginning, permissions:
xhost +local:rootGrab FN+F4 event code, by pressing this combination of keys. 3 times to be sure.
Now,
cat /var/log/acpid.logand at the bottom you will see your 3 strikes, something like that:
[...]
Jun 29 04:15:25 thinkpad acpid: completed event "ibm/hotkey HKEY 00000080 00001004"
Jun 29 04:15:25 thinkpad acpid: received event "ibm/hotkey HKEY 00000080 00001004"Now, when you have your event code you have to edit your event script, which is going to define, what action to do if the event is met.
So we are now going to edit the script, with your favourite text editor, lets say nano ![]()
nano /etc/acpi/events/sleepthis script contains what follows:
event=(button[ /]sleep|ibm/hotkey HKEY 00000080 00001004)
action=/etc/acpi/sleep.shdouble check the numbers (both strings must be identical of course)
now we have to make an action script which will put your laptop in a sleep state.
nano /etc/acpi/sleep.sh#!/bin/sh
# remove USB 1.1 driver
rmmod uhci_hcd
# sync filesystem and clock
sync
/sbin/hwclock --systohc
# swich to console
chvt 6
# go to sleep
sleep 5 && echo -n "mem" > /sys/power/state
# readjust the clock
/sbin/hwclock --adjust
/sbin/hwclock --hctosys
# reload USB 1.1 driver
modprobe uhci_hcd
# insomnia? ;)
chvt 7And the last touch:
chmod +x /etc/acpi/sleep.shNow you only have to restart the deamon:
./etc/rc.d/acpid restartLast few words:
If your computer goes to sleep, but after awaking it screen stays black/blank (but not frozen, just black, with sounds, etc), you can try editing grub and pass command acpi_sleep=s3_bios to your kernel:
/boot/grub/menu.lst
title Arch Linux
root (hd0,0)
kernel /boot/vmlinuz26 root=/dev/sda1 ro vga=775 acpi_sleep=s3_bios
initrd /boot/kernel26.imgSo configure it once and forget about it forever ![]()
Offline
Thanks, I didn't know I could get the keycode from acpid's log...
Last edited by Gullible Jones (2008-06-29 03:22:51)
Offline
Pages: 1