main/acpid: power-supply-ac: ignore batteries

(cherry picked from commit 92eb06eff14c158baddc4e7b700f0587599f063f)
This commit is contained in:
dlatchx 2024-04-17 20:44:20 +02:00 committed by Jakub Jirutka
parent acab6cba6d
commit 87196a56fc
2 changed files with 7 additions and 2 deletions

View File

@ -2,7 +2,7 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=acpid
pkgver=2.0.34
pkgrel=3
pkgrel=4
pkgdesc="The ACPI Daemon (acpid) With Netlink Support"
url="https://sourceforge.net/projects/acpid2/"
arch="all"
@ -60,7 +60,7 @@ openrc() {
sha512sums="
2bf92295b55bb44fe83074b3e0c1ae639f63edaeea84b2184ae95b38852be40f380d5413110b8c0fcb2efc2ec01bf4764e1dcb97022fc724bebbfc35c0b63c81 acpid-2.0.34.tar.xz
050c81446ac563d5d4c5d63a3e0b41558d5934427589114dc8b3215b72a1bd5923e0b8812e6d2265a6f53b6b0bcf8d7cc84d8ea6f2993ceea49c3c864c89c42c handler.sh
daf2510f202377a4db9b52448e4805bc4468c66f507cd4e676dc589306b716043c653ff18b697a4c37e5a005123a64a0278f3e4980504d98dd42ac9e95a3443f power-supply-ac
2478afa7cc072f84907789bd90d0d85c8a2f450a29a09637d764d665fd5e68ac7dee3a4ef9e183136e5b0745504c52e7357c5cdb172328c7e7318aa77ecd9c52 power-supply-ac
f6df3e75198e779826c187038804ba80e7a445567342ac912ff4e5d894ce936fb9347146c302c7d7c9bbc8b3a0e47aeee9d23a4b297ee37e3938b7310a1b5ad9 lid-closed
8ec95453c21c5801a0864a5a91fd1d714f29d10a50658e93f027a395dcff91cd0e1ea5047ece199131e6205a422ae6f1887b388068630a0579995e3069d6a3bd suspend
2e04e5c8a428bfc653b4d56f5a2ff4472169a094ed9eee4b02ea88c755848e4803a0edeb054e152516ee50cb67c8c2be2c43e2e9db9dc80b7fcf218b8907ef6c anything

View File

@ -11,7 +11,12 @@ rc=0
# Iterate through power supplies sysfs knows about.
for ps in /sys/class/power_supply/*; do
# Ignore batteries.
[ -r $ps/type ] && [ "$(cat $ps/type)" = 'Battery' ] && continue
# Ignore when no online info (we return 0 when no AC power found).
[ -r $ps/online ] || continue
# We know we have an AC adaptor, our default return changes to failed.
rc=1