diff --git a/hardware/powermanagement/acpid/actions.py b/hardware/powermanagement/acpid/actions.py index ea97fd797d..b8726c1823 100644 --- a/hardware/powermanagement/acpid/actions.py +++ b/hardware/powermanagement/acpid/actions.py @@ -4,17 +4,13 @@ # Licensed under the GNU General Public License, version 3. # See the file https://www.gnu.org/licenses/gpl-3.0.txt -from pisi.actionsapi import autotools -from pisi.actionsapi import pisitools -from pisi.actionsapi import get +from pisi.actionsapi import autotools, pisitools, get def setup(): - autotools.configure() + autotools.configure() def build(): - autotools.make() + autotools.make() def install(): - autotools.rawInstall("DESTDIR=%s" % get.installDIR()) - - pisitools.dodoc('README', 'COPYING') + autotools.rawInstall("DESTDIR=%s" % get.installDIR()) diff --git a/hardware/powermanagement/acpid/files/anything b/hardware/powermanagement/acpid/files/anything new file mode 100644 index 0000000000..d1828989b0 --- /dev/null +++ b/hardware/powermanagement/acpid/files/anything @@ -0,0 +1,3 @@ +# Pass all events to our one handler script +event=.* +action=/etc/acpi/handler.sh %e diff --git a/hardware/powermanagement/acpid/files/handler.sh b/hardware/powermanagement/acpid/files/handler.sh new file mode 100644 index 0000000000..1ff368bc1e --- /dev/null +++ b/hardware/powermanagement/acpid/files/handler.sh @@ -0,0 +1,96 @@ +#!/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 + +# $1 should be + or - to step up or down the brightness. +step_backlight() { + for backlight in /sys/class/backlight/*/; do + [ -d "$backlight" ] || continue + step=$(( $(cat "$backlight/max_brightness") / 20 )) + [ "$step" -gt "1" ] || step=1 #fallback if gradation is too low + printf '%s' "$(( $(cat "$backlight/brightness") $1 step ))" >"$backlight/brightness" + done +} + +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" + + +case "$1" in + button/power) + case "$2" in + PBTN|PWRF) + logger "PowerButton pressed: $2, shutting down..." + shutdown -P now + ;; + *) logger "ACPI action undefined: $2" ;; + esac + ;; + button/sleep) + case "$2" in + SBTN|SLPB) + # suspend-to-ram + logger "Sleep Button pressed: $2, suspending..." + zzz + ;; + *) logger "ACPI action undefined: $2" ;; + esac + ;; + ac_adapter) + case "$2" in + AC|ACAD|ADP0) + case "$4" in + 00000000) + printf '%s' "$minspeed" >"$setspeed" + #/etc/laptop-mode/laptop-mode start + ;; + 00000001) + printf '%s' "$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) + case "$3" in + close) + # suspend-to-ram + logger "LID closed, suspending..." + zzz + ;; + open) + logger "LID opened" + ;; + *) logger "ACPI action undefined (LID): $2";; + esac + ;; + video/brightnessdown) + step_backlight - + ;; + video/brightnessup) + step_backlight + + ;; + *) + logger "ACPI group/action undefined: $1 / $2" + ;; +esac diff --git a/hardware/powermanagement/acpid/pspec.xml b/hardware/powermanagement/acpid/pspec.xml index 5b4cc0efdc..c88582ff64 100644 --- a/hardware/powermanagement/acpid/pspec.xml +++ b/hardware/powermanagement/acpid/pspec.xml @@ -1,103 +1,114 @@ - - acpid - https://sourceforge.net/projects/acpid2/ - - PisiLinux Community - admins@pisilinux.org - - GPLv2+ - service - app:console - ACPI daemon that dispatches ACPI events to user-space programs - acpid is a flexible and extensible daemon for ACPI (Advanced Configuration and Power Interface) event dispatching. - mirrors://sourceforge/acpid2/acpid-2.0.33.tar.xz - - - - + + acpid + https://sourceforge.net/projects/acpid2/ + + PisiLinux Community + admins@pisilinux.org + + GPL-2 + service + app:console + ACPI daemon that dispatches ACPI events to user-space programs + acpid is a flexible and extensible daemon for ACPI (Advanced Configuration and Power Interface) event dispatching. + + mirrors://sourceforge/acpid2/acpid-2.0.34.tar.xz + + + + + - - acpid - - /usr/bin - /usr/sbin - /etc/acpi/actions - /etc/acpi/events - /etc/conf.d - /usr/share/dbus-1/services/acpid.service - /usr/share/doc - /usr/share/man - - - acpid.power.sh - fedora/acpid.power.conf - fedora/acpid.video.conf - fedora/acpid.sysconfig - - - System.Service - - + + acpid + + /usr/bin + /usr/sbin + /etc/acpi + /etc/acpi/events + /etc/conf.d + /usr/share/dbus-1/services/acpid.service + /usr/share/doc + /usr/share/man + + + handler.sh + anything + + + + System.Service + + - - - 2021-11-04 - 2.0.33 - Version bump. - Mustafa Cinasal - muscnsl@gmail.com - - - 2021-02-18 - 2.0.32 - Rebuild. - Mustafa Cinasal - muscnsl@gmail.com - - - 2020-03-02 - 2.0.32 - Version bump. - Mustafa Cinasal - muscnsl@gmail.com - - - 2019-02-10 - 2.0.31 - Version bump. - Ertuğrul Erata - ertugrulerata@gmail.com - - - 2018-08-13 - 2.0.28 - Rebuild - Mustafa Cinasal - muscnsl@gmail.com - - - 2018-05-13 - 2.0.28 - Rebuild - Mustafa Cinasal - muscnsl@gmail.com - - - 2017-04-06 - 2.0.28 - Version bump - Kamil Atlı - suvari@pisilinux.org - - - 2016-07-02 - 2.0.27 - First release - Kamil Atlı - suvari@pisilinux.org - - + + + 2022-11-10 + 2.0.34 + Version bump. + fury + uglyside@yandex.ru + + + 2021-11-04 + 2.0.33 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + + + 2021-02-18 + 2.0.32 + Rebuild. + Mustafa Cinasal + muscnsl@gmail.com + + + 2020-03-02 + 2.0.32 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + + + 2019-02-10 + 2.0.31 + Version bump. + Ertuğrul Erata + ertugrulerata@gmail.com + + + 2018-08-13 + 2.0.28 + Rebuild + Mustafa Cinasal + muscnsl@gmail.com + + + 2018-05-13 + 2.0.28 + Rebuild + Mustafa Cinasal + muscnsl@gmail.com + + + 2017-04-06 + 2.0.28 + Version bump + Kamil Atlı + suvari@pisilinux.org + + + 2016-07-02 + 2.0.27 + First release + Kamil Atlı + suvari@pisilinux.org + +