You are not logged in.
Pages: 1
Due to certain bugs with powersaved, I've written my own little suspend script to handle the unloading/loading of modules and daemons and the suspending itself. How do I tell ACPI to run this script when I close the lid, or trigger some other event?
Who is this doin' this synthetic type of alpha beta psychedelic funkin'?
Offline
Create a file in /etc/acpi/events/ or edit /etc/acpi.handler.sh putting it in there. As an example I edited the /etc/acpi.handler.sh script to this setting my custom suspend script to run when I press the power button (because it is for a desktop and that is the only ACPI button I have available)
#!/bin/sh
# Default acpi script that takes an entry for all actions
# NOTE: This is a 2.6-centric script. If you use 2.4.x, you'll have to
# modify it to not use /sys
minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
set $*
case "$1" in
button/power)
#echo "PowerButton pressed!">/dev/tty5
case "$2" in
PWRF) /usr/local/bin/suspend ;;
# PWRF) logger "PowerButton pressed: $2" ;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
I only posted the first part of the file to save space the rest was unmodified.
Offline
Fantastic, works like a charm
Who is this doin' this synthetic type of alpha beta psychedelic funkin'?
Offline
Pages: 1