X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=lenovo-x220-linuxacpi%2Fetc%2Facpi%2Fdefault.sh;fp=lenovo-x220-linuxacpi%2Fetc%2Facpi%2Fdefault.sh;h=8be6f3e1a9f4c7b71873e2af27599960b19c4753;hb=3940751562b91c8ff785e902a618cc0bf71e2b5e;hp=0000000000000000000000000000000000000000;hpb=ba8d944658a4e8b99d9c5e4762da74ca5475d213;p=shutils.git diff --git a/lenovo-x220-linuxacpi/etc/acpi/default.sh b/lenovo-x220-linuxacpi/etc/acpi/default.sh new file mode 100755 index 0000000..8be6f3e --- /dev/null +++ b/lenovo-x220-linuxacpi/etc/acpi/default.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# /etc/acpi/default.sh +# Default acpi script that takes an entry for all actions + +set $* + +group=${1%%/*} +action=${1#*/} +device=$2 +id=$3 +value=$4 + +log_unhandled() { + logger "ACPI event unhandled: $*" +} + +case "$group" in + button) + case "$action" in + power) + /etc/acpi/actions/powerbtn.sh + ;; + + # if your laptop doesnt turn on/off the display via hardware + # switch and instead just generates an acpi event, you can force + # X to turn off the display via dpms. note you will have to run + # 'xhost +local:0' so root can access the X DISPLAY. + #lid) + # xset dpms force off + # ;; + + *) log_unhandled $* ;; + esac + ;; + + ac_adapter) + case "$value" in + # Add code here to handle when the system is unplugged + # (maybe change cpu scaling to powersave mode). For + # multicore systems, make sure you set powersave mode + # for each core! + #*0) + # cpufreq-set -g powersave + # ;; + + # Add code here to handle when the system is plugged in + # (maybe change cpu scaling to performance mode). For + # multicore systems, make sure you set performance mode + # for each core! + #*1) + # cpufreq-set -g performance + # ;; + + *) log_unhandled $* ;; + esac + ;; + + *) log_unhandled $* ;; +esac