dip

old school recipes for janitorial snafu.
git clone git://git.ricketyspace.net/dip.git
Log | Files | Refs

commit 2f0eaff3e502cedc47910b7a86d36be7538bb861
parent f25845dc23baf0d7130478d24c1e7b7e525ae52f
Author: rsiddharth <s@ricketyspace.net>
Date:   Tue, 31 Jul 2018 23:34:31 +0000

etc/acpi: Add default.sh.

Diffstat:
etc/acpi/default.sh | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+), 0 deletions(-)

diff --git a/etc/acpi/default.sh b/etc/acpi/default.sh @@ -0,0 +1,66 @@ +#!/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 + ;; + lid) + case "$id" in + close) + s2ram + ;; + *) log_unhandled $* ;; + esac + ;; + # 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