This commit is contained in:
4fury-c3440d8
2022-11-10 09:09:58 +03:00
parent 9f4d9f19e8
commit 250ea8efe0
4 changed files with 211 additions and 105 deletions
+4 -8
View File
@@ -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())
@@ -0,0 +1,3 @@
# Pass all events to our one handler script
event=.*
action=/etc/acpi/handler.sh %e
@@ -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
+108 -97
View File
@@ -1,103 +1,114 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "https://pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>acpid</Name>
<Homepage>https://sourceforge.net/projects/acpid2/</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Packager>
<License>GPLv2+</License>
<IsA>service</IsA>
<IsA>app:console</IsA>
<Summary>ACPI daemon that dispatches ACPI events to user-space programs</Summary>
<Description>acpid is a flexible and extensible daemon for ACPI (Advanced Configuration and Power Interface) event dispatching.</Description>
<Archive sha1sum="b3e06c3f2213db8ee1a9024cf372fb30e2fab637" type="tarxz">mirrors://sourceforge/acpid2/acpid-2.0.33.tar.xz</Archive>
<Patches>
<!-- <Patch level="1">acpid-2.0.32-powerbtn-gsd-power.patch</Patch> -->
</Patches>
</Source>
<Source>
<Name>acpid</Name>
<Homepage>https://sourceforge.net/projects/acpid2/</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Packager>
<License>GPL-2</License>
<IsA>service</IsA>
<IsA>app:console</IsA>
<Summary>ACPI daemon that dispatches ACPI events to user-space programs</Summary>
<Description>acpid is a flexible and extensible daemon for ACPI (Advanced Configuration and Power Interface) event dispatching.</Description>
<Archive sha1sum="9322112027e4aa5a8d1b97ec64ef1d150ff0f4fc" type="tarxz">
mirrors://sourceforge/acpid2/acpid-2.0.34.tar.xz
</Archive>
<Patches>
<!-- <Patch level="1"></Patch> -->
</Patches>
</Source>
<Package>
<Name>acpid</Name>
<Files>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="executable">/usr/sbin</Path>
<Path fileType="executable">/etc/acpi/actions</Path>
<Path fileType="data">/etc/acpi/events</Path>
<Path fileType="config">/etc/conf.d</Path>
<Path fileType="data">/usr/share/dbus-1/services/acpid.service</Path>
<Path fileType="doc">/usr/share/doc</Path>
<Path fileType="man">/usr/share/man</Path>
</Files>
<AdditionalFiles>
<AdditionalFile owner="root" permission="0755" target="/etc/acpi/actions/power.sh">acpid.power.sh</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/etc/acpi/events/power.conf">fedora/acpid.power.conf</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/etc/acpi/events/video.conf">fedora/acpid.video.conf</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/etc/conf.d/acpid">fedora/acpid.sysconfig</AdditionalFile>
</AdditionalFiles>
<Provides>
<COMAR script="service.py">System.Service</COMAR>
</Provides>
</Package>
<Package>
<Name>acpid</Name>
<Files>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="executable">/usr/sbin</Path>
<Path fileType="executable">/etc/acpi</Path>
<Path fileType="data">/etc/acpi/events</Path>
<Path fileType="config">/etc/conf.d</Path>
<Path fileType="data">/usr/share/dbus-1/services/acpid.service</Path>
<Path fileType="doc">/usr/share/doc</Path>
<Path fileType="man">/usr/share/man</Path>
</Files>
<AdditionalFiles>
<AdditionalFile owner="root" permission="0755" target="/etc/acpi/handler.sh">handler.sh</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/etc/acpi/events/anything">anything</AdditionalFile>
<!-- <AdditionalFile owner="root" permission="0755" target="/etc/acpi/actions/power.sh">acpid.power.sh</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/etc/acpi/events/power.conf">fedora/acpid.power.conf</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/etc/acpi/events/video.conf">fedora/acpid.video.conf</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/etc/conf.d/acpid">fedora/acpid.sysconfig</AdditionalFile> -->
</AdditionalFiles>
<Provides>
<COMAR script="service.py">System.Service</COMAR>
</Provides>
</Package>
<History>
<Update release="8">
<Date>2021-11-04</Date>
<Version>2.0.33</Version>
<Comment>Version bump.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="7">
<Date>2021-02-18</Date>
<Version>2.0.32</Version>
<Comment>Rebuild.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="6">
<Date>2020-03-02</Date>
<Version>2.0.32</Version>
<Comment>Version bump.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="5">
<Date>2019-02-10</Date>
<Version>2.0.31</Version>
<Comment>Version bump.</Comment>
<Name>Ertuğrul Erata</Name>
<Email>ertugrulerata@gmail.com</Email>
</Update>
<Update release="4">
<Date>2018-08-13</Date>
<Version>2.0.28</Version>
<Comment>Rebuild</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="3">
<Date>2018-05-13</Date>
<Version>2.0.28</Version>
<Comment>Rebuild</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="2">
<Date>2017-04-06</Date>
<Version>2.0.28</Version>
<Comment>Version bump</Comment>
<Name>Kamil Atlı</Name>
<Email>suvari@pisilinux.org</Email>
</Update>
<Update release="1">
<Date>2016-07-02</Date>
<Version>2.0.27</Version>
<Comment>First release</Comment>
<Name>Kamil Atlı</Name>
<Email>suvari@pisilinux.org</Email>
</Update>
</History>
<History>
<Update release="9">
<Date>2022-11-10</Date>
<Version>2.0.34</Version>
<Comment>Version bump.</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="8">
<Date>2021-11-04</Date>
<Version>2.0.33</Version>
<Comment>Version bump.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="7">
<Date>2021-02-18</Date>
<Version>2.0.32</Version>
<Comment>Rebuild.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="6">
<Date>2020-03-02</Date>
<Version>2.0.32</Version>
<Comment>Version bump.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="5">
<Date>2019-02-10</Date>
<Version>2.0.31</Version>
<Comment>Version bump.</Comment>
<Name>Ertuğrul Erata</Name>
<Email>ertugrulerata@gmail.com</Email>
</Update>
<Update release="4">
<Date>2018-08-13</Date>
<Version>2.0.28</Version>
<Comment>Rebuild</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="3">
<Date>2018-05-13</Date>
<Version>2.0.28</Version>
<Comment>Rebuild</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="2">
<Date>2017-04-06</Date>
<Version>2.0.28</Version>
<Comment>Version bump</Comment>
<Name>Kamil Atlı</Name>
<Email>suvari@pisilinux.org</Email>
</Update>
<Update release="1">
<Date>2016-07-02</Date>
<Version>2.0.27</Version>
<Comment>First release</Comment>
<Name>Kamil Atlı</Name>
<Email>suvari@pisilinux.org</Email>
</Update>
</History>
</PISI>