Add acpid to boot runlevel. Add support backlight keys for Sony Vaio

master
Mike Hiretsky 14 years ago
parent a719aa910f
commit 1191d65a10

@ -11,7 +11,9 @@ CHANGE LOG
* Added a parallel installation packages.
* Use developer profile in building system if version of system have long number (X.X.X).
* Fix bug of installation to hard drive containing only one partition.
* Add 755 permission for templates into /etc/NetworkManager/dispatcher.d directory.
* Added 755 permission for templates into /etc/NetworkManager/dispatcher.d directory.
* Added acpid daemon for laptop and livecd.
* Added support backlight and eject keys for Sony Vaio.
1.3.9
* Add change partition id for system installation.

@ -0,0 +1,106 @@
#!/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
BACKLIGHT_DIR=/sys/devices/virtual/backlight/acpi_video0
# increase backlight
inc_backlight() {
local cur_backlight=$(cat $BACKLIGHT_DIR/actual_brightness)
local max_backlight=$(cat $BACKLIGHT_DIR/max_brightness)
[[ $cur_backlight -lt $max_backlight ]] &&
echo $(($cur_backlight + 1)) >$BACKLIGHT_DIR/brightness
}
# decrease backlight
dec_backlight() {
local cur_backlight=$(cat $BACKLIGHT_DIR/actual_brightness)
local max_backlight=$(cat $BACKLIGHT_DIR/max_brightness)
[[ $cur_backlight -gt 0 ]] &&
echo $(($cur_backlight - 1)) >$BACKLIGHT_DIR/brightness
}
log_unhandled() {
logger "ACPI event unhandled: $*"
}
case "$group" in
button)
case "$action" in
power)
/sbin/init 0
;;
# 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
;;
sony)
case "$action" in
hotkey)
case "$device" in
SNC)
case "$id" in
*01)
case "$value" in
*010)
dec_backlight
;;
*011)
inc_backlight
;;
*040)
eject
;;
*) log_unhandled $* ;;
esac ;;
*) log_unhandled $* ;;
esac
;;
*) log_unhandled $* ;;
esac
;;
*) log_unhandled $* ;;
esac
;;
*) log_unhandled $* ;;
esac
Loading…
Cancel
Save