Little ACPI problem I had - GNU/Linux

Users browsing this thread: 2 Guest(s)
venam
Administrators
The light suddenly stopped again.
It's not a problem in itself because the battery is recognized, though the adapter is not.

Quote:#!/bin/sh
# Default acpi script that takes an entry for all actions

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)
case "$2" in
PBTN|PWRF)
logger "PowerButton pressed: $2"
poweroff
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
button/sleep)
case "$2" in
SLPB|SBTN)
echo -n mem >/sys/power/state
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
ac_adapter)
case "$2" in
AC|ACAD|ADP0|PNP)
case "$4" in
00000000)
echo -n $minspeed >$setspeed
#/etc/laptop-mode/laptop-mode start
;;
00000001)
echo -n $maxspeed >$setspeed
#/etc/laptop-mode/laptop-mode stop
;;
esac
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
battery)
case "$2" in
BAT0)
case "$4" in
00000000)
logger 'Battery online'
;;
00000001)
logger 'Battery offline'
;;
esac
;;
CPU0)
;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
button/lid)
case "$3" in
close)
logger 'LID closed'
;;
open)
logger 'LID opened'
;;
*)
logger "ACPI action undefined: $3"
;;
esac
;;
*)
logger "ACPI group/action undefined: $1 / $2"
;;
esac

# vim:set ts=4 sw=4 ft=sh et:


Messages In This Thread
Little ACPI problem I had - by venam - 19-08-2012, 03:20 PM
RE: Little ACPI problem I had - by venam - 20-08-2012, 02:07 PM
RE: Little ACPI problem I had - by simon - 20-08-2012, 02:59 PM
RE: Little ACPI problem I had - by htor - 21-08-2012, 02:23 PM
RE: Little ACPI problem I had - by venam - 21-08-2012, 06:25 PM
RE: Little ACPI problem I had - by htor - 24-08-2012, 07:26 AM
RE: Little ACPI problem I had - by venam - 25-08-2012, 04:48 PM
RE: Little ACPI problem I had - by simon - 27-09-2012, 10:00 AM