From 1c44c63f6f89eaeb5b1f9fc16c7d21120bd13ab5 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Sun, 16 Feb 2014 13:30:15 -0600 Subject: acpid:2.0.20 --- abs/core/acpid/PKGBUILD | 38 ++++++++++------------- abs/core/acpid/__changelog | 5 +-- abs/core/acpid/acpid.conf | 5 --- abs/core/acpid/acpid.rc | 40 ------------------------ abs/core/acpid/acpid.service | 3 +- abs/core/acpid/acpid.socket | 2 +- abs/core/acpid/handler.sh | 21 +++++-------- abs/core/acpid/handler.sh.runit | 68 ----------------------------------------- 8 files changed, 28 insertions(+), 154 deletions(-) delete mode 100644 abs/core/acpid/acpid.conf delete mode 100644 abs/core/acpid/acpid.rc mode change 100644 => 100755 abs/core/acpid/handler.sh delete mode 100644 abs/core/acpid/handler.sh.runit diff --git a/abs/core/acpid/PKGBUILD b/abs/core/acpid/PKGBUILD index a4d931a..8cd7875 100644 --- a/abs/core/acpid/PKGBUILD +++ b/abs/core/acpid/PKGBUILD @@ -1,38 +1,29 @@ -# $Id: PKGBUILD 71877 2012-06-02 17:57:44Z seblu $ -# Maintainer: Sébastien Luttringer +# $Id: PKGBUILD 97250 2013-09-15 20:35:17Z seblu $ +# Maintainer: Sébastien Luttringer # Contributor: xduugu # Contributor: Manolis Tzanidakis # Contributor: Jonathan Schmidt /dev/null - if [ $? -gt 0 ]; then - stat_fail - else - rm_daemon acpid - stat_done - fi - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - *) - echo "usage: $0 {start|stop|restart}" -esac -exit 0 - -# vim:set ts=2 sw=2 ft=sh et: diff --git a/abs/core/acpid/acpid.service b/abs/core/acpid/acpid.service index 4c0e073..022f72a 100644 --- a/abs/core/acpid/acpid.service +++ b/abs/core/acpid/acpid.service @@ -3,8 +3,7 @@ Description=ACPI event daemon Requires=acpid.socket [Service] -EnvironmentFile=/etc/conf.d/acpid -ExecStart=/usr/sbin/acpid -f $ACPID_ARGS +ExecStart=/usr/bin/acpid -f [Install] WantedBy=multi-user.target diff --git a/abs/core/acpid/acpid.socket b/abs/core/acpid/acpid.socket index 1e5365b..1b23f87 100644 --- a/abs/core/acpid/acpid.socket +++ b/abs/core/acpid/acpid.socket @@ -2,7 +2,7 @@ Description=ACPID Listen Socket [Socket] -ListenStream=/run/acpid.socket +ListenStream=/var/run/acpid.socket [Install] WantedBy=sockets.target diff --git a/abs/core/acpid/handler.sh b/abs/core/acpid/handler.sh old mode 100644 new mode 100755 index b5a548f..206d656 --- a/abs/core/acpid/handler.sh +++ b/abs/core/acpid/handler.sh @@ -1,18 +1,13 @@ -#!/bin/sh +#!/bin/bash # 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 'PowerButton pressed' + /usr/bin/runit-init 0 + /usr/bin/poweroff ;; *) logger "ACPI action undefined: $2" @@ -22,7 +17,7 @@ case "$1" in button/sleep) case "$2" in SLPB|SBTN) - echo -n mem >/sys/power/state + logger 'SleepButton pressed' ;; *) logger "ACPI action undefined: $2" @@ -34,12 +29,10 @@ case "$1" in AC|ACAD|ADP0) case "$4" in 00000000) - echo -n $minspeed >$setspeed - #/etc/laptop-mode/laptop-mode start + logger 'AC unpluged' ;; 00000001) - echo -n $maxspeed >$setspeed - #/etc/laptop-mode/laptop-mode stop + logger 'AC pluged' ;; esac ;; diff --git a/abs/core/acpid/handler.sh.runit b/abs/core/acpid/handler.sh.runit deleted file mode 100644 index 9fb2593..0000000 --- a/abs/core/acpid/handler.sh.runit +++ /dev/null @@ -1,68 +0,0 @@ -#!/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) logger "PowerButton pressed: $2" - /sbin/runit-init 0 - /sbin/poweroff - ;; - *) logger "ACPI action undefined: $2" ;; - esac - ;; - button/sleep) - case "$2" in - SLPB) echo -n mem >/sys/power/state ;; - *) logger "ACPI action undefined: $2" ;; - esac - ;; - ac_adapter) - case "$2" in - AC) - 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) #echo "offline" >/dev/tty5 - ;; - 00000001) #echo "online" >/dev/tty5 - ;; - esac - ;; - CPU0) - ;; - *) logger "ACPI action undefined: $2" ;; - esac - ;; - button/lid) - #echo "LID switched!">/dev/tty5 - ;; - *) - logger "ACPI group/action undefined: $1 / $2" - ;; -esac -- cgit v0.12