diff options
author | davidovski <david@davidovski.xyz> | 2022-05-04 23:52:30 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-05-04 23:52:30 +0100 |
commit | 739c65c54cb0e957df5e9b76f93fb02554e5cac3 (patch) | |
tree | 09ddfa0a342f3ea9de136cb50abdd79821bf1b53 /extra/acpid | |
parent | 4c585ad54388285500fd18a6aaa516894e0f2c16 (diff) |
moved everything to new file formatting
Diffstat (limited to 'extra/acpid')
-rw-r--r-- | extra/acpid/acpid.confd | 7 | ||||
-rw-r--r-- | extra/acpid/acpid.initd | 28 | ||||
-rw-r--r-- | extra/acpid/anything | 3 | ||||
-rw-r--r-- | extra/acpid/handler.sh | 36 | ||||
-rw-r--r-- | extra/acpid/lid-closed | 21 | ||||
-rw-r--r-- | extra/acpid/power-supply-ac | 25 |
6 files changed, 0 insertions, 120 deletions
diff --git a/extra/acpid/acpid.confd b/extra/acpid/acpid.confd deleted file mode 100644 index 2b3d304..0000000 --- a/extra/acpid/acpid.confd +++ /dev/null @@ -1,7 +0,0 @@ -# Configuration file for /etc/init.d/acpid (from acpid package) - -# Additional arguments to pass to acpid. -command_args="--logevents" - -# Uncomment to use process supervisor. -#supervisor="supervise-daemon" diff --git a/extra/acpid/acpid.initd b/extra/acpid/acpid.initd deleted file mode 100644 index c2d60f9..0000000 --- a/extra/acpid/acpid.initd +++ /dev/null @@ -1,28 +0,0 @@ -#!/sbin/openrc-run - -description="The ACPI Daemon" - -extra_started_commands="reload" -description_reload="Reload configuration" - -command="/sbin/acpid" -command_args="--foreground ${command_args:-}" -command_background="yes" -pidfile="/run/$RC_SVCNAME.pid" - -depend() { - need dev localmount - after hwdrivers modules - provide acpid - keyword -vserver -lxc -} - -reload() { - ebegin "Reloading $RC_SVCNAME configuration" - if [ "$supervisor" ]; then - $supervisor "$RC_SVCNAME" --signal HUP - else - start-stop-daemon --pidfile "$pidfile" --signal HUP - fi - eend $? -} diff --git a/extra/acpid/anything b/extra/acpid/anything deleted file mode 100644 index d182898..0000000 --- a/extra/acpid/anything +++ /dev/null @@ -1,3 +0,0 @@ -# Pass all events to our one handler script -event=.* -action=/etc/acpi/handler.sh %e diff --git a/extra/acpid/handler.sh b/extra/acpid/handler.sh deleted file mode 100644 index 412ac02..0000000 --- a/extra/acpid/handler.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# vim: set ts=4: -# -# This is the default ACPI handler script that is configured in -# /etc/acpi/events/anything to be called for every ACPI event. -# You can edit it and add your own actions; treat it as a configuration file. -# -PATH="/usr/share/acpid:$PATH" -alias log='logger -t acpid' - -# <dev-class>:<dev-name>:<notif-value>:<sup-value> -case "$1:$2:$3:$4" in - -button/power:PWRF:*) - log 'Power button pressed' - # Shutdown the system unless it has a lid (notebook). - [ -e /proc/acpi/button/lid/LID ] || poweroff -;; -button/sleep:SLPB:*) - log 'Sleep button pressed' - # Suspend to RAM. - zzz -;; -button/lid:*:close:*) - log 'Lid closed' - # Suspend to RAM if AC adapter is not connected. - power-supply-ac || zzz -;; -ac_adapter:*:*:*0) - log 'AC adapter unplugged' - # Suspend to RAM if notebook's lid is closed. - lid-closed && zzz -;; -esac - -exit 0 diff --git a/extra/acpid/lid-closed b/extra/acpid/lid-closed deleted file mode 100644 index 57ffb71..0000000 --- a/extra/acpid/lid-closed +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# This script exits with status 0 if the latop's lid is closed, 1 if opened, -# 10 if /proc/acpi/button/lid/LID/state does not exist or is not readable. -set -u - -STATE_FILE='/proc/acpi/button/lid/LID/state' - -verbose=false -[ "${1:-}" = '-v' ] && verbose=true - -if ! [ -r "$STATE_FILE" ]; then - $verbose && echo "$STATE_FILE does not exist or is not readable!" >&2 - exit 10 -fi - -read -r _ state < "$STATE_FILE" || exit 10 - -[ "$state" = 'closed' ]; rc=$? - -$verbose && echo $rc -exit $rc diff --git a/extra/acpid/power-supply-ac b/extra/acpid/power-supply-ac deleted file mode 100644 index 337aae2..0000000 --- a/extra/acpid/power-supply-ac +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# This script exits with status 0 when the computer is on AC power (or no AC -# power supply found), 1 otherwise (i.e. running on battery). -set -u - -verbose=false -[ "${1:-}" = '-v' ] && verbose=true - -# If we do not have any power supplies, assume we are on AC. -rc=0 - -# Iterate through power supplies sysfs knows about. -for ps in /sys/class/power_supply/*; do - [ -r $ps/online ] || continue - # We know we have an AC adaptor, our default return changes to failed. - rc=1 - - if [ "$(cat $ps/online)" -eq 1 ]; then - rc=0 - break - fi -done - -$verbose && echo $rc -exit $rc |