acpid.
This commit is contained in:
@@ -4,17 +4,13 @@
|
|||||||
# Licensed under the GNU General Public License, version 3.
|
# Licensed under the GNU General Public License, version 3.
|
||||||
# See the file https://www.gnu.org/licenses/gpl-3.0.txt
|
# See the file https://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
|
||||||
from pisi.actionsapi import autotools
|
from pisi.actionsapi import autotools, pisitools, get
|
||||||
from pisi.actionsapi import pisitools
|
|
||||||
from pisi.actionsapi import get
|
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
autotools.configure()
|
autotools.configure()
|
||||||
|
|
||||||
def build():
|
def build():
|
||||||
autotools.make()
|
autotools.make()
|
||||||
|
|
||||||
def install():
|
def install():
|
||||||
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
|
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
|
||||||
|
|
||||||
pisitools.dodoc('README', 'COPYING')
|
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -1,103 +1,114 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<!DOCTYPE PISI SYSTEM "https://pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
<!DOCTYPE PISI SYSTEM "https://pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
||||||
<PISI>
|
<PISI>
|
||||||
<Source>
|
<Source>
|
||||||
<Name>acpid</Name>
|
<Name>acpid</Name>
|
||||||
<Homepage>https://sourceforge.net/projects/acpid2/</Homepage>
|
<Homepage>https://sourceforge.net/projects/acpid2/</Homepage>
|
||||||
<Packager>
|
<Packager>
|
||||||
<Name>PisiLinux Community</Name>
|
<Name>PisiLinux Community</Name>
|
||||||
<Email>admins@pisilinux.org</Email>
|
<Email>admins@pisilinux.org</Email>
|
||||||
</Packager>
|
</Packager>
|
||||||
<License>GPLv2+</License>
|
<License>GPL-2</License>
|
||||||
<IsA>service</IsA>
|
<IsA>service</IsA>
|
||||||
<IsA>app:console</IsA>
|
<IsA>app:console</IsA>
|
||||||
<Summary>ACPI daemon that dispatches ACPI events to user-space programs</Summary>
|
<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>
|
<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>
|
<Archive sha1sum="9322112027e4aa5a8d1b97ec64ef1d150ff0f4fc" type="tarxz">
|
||||||
<Patches>
|
mirrors://sourceforge/acpid2/acpid-2.0.34.tar.xz
|
||||||
<!-- <Patch level="1">acpid-2.0.32-powerbtn-gsd-power.patch</Patch> -->
|
</Archive>
|
||||||
</Patches>
|
<Patches>
|
||||||
</Source>
|
<!-- <Patch level="1"></Patch> -->
|
||||||
|
</Patches>
|
||||||
|
</Source>
|
||||||
|
|
||||||
<Package>
|
<Package>
|
||||||
<Name>acpid</Name>
|
<Name>acpid</Name>
|
||||||
<Files>
|
<Files>
|
||||||
<Path fileType="executable">/usr/bin</Path>
|
<Path fileType="executable">/usr/bin</Path>
|
||||||
<Path fileType="executable">/usr/sbin</Path>
|
<Path fileType="executable">/usr/sbin</Path>
|
||||||
<Path fileType="executable">/etc/acpi/actions</Path>
|
<Path fileType="executable">/etc/acpi</Path>
|
||||||
<Path fileType="data">/etc/acpi/events</Path>
|
<Path fileType="data">/etc/acpi/events</Path>
|
||||||
<Path fileType="config">/etc/conf.d</Path>
|
<Path fileType="config">/etc/conf.d</Path>
|
||||||
<Path fileType="data">/usr/share/dbus-1/services/acpid.service</Path>
|
<Path fileType="data">/usr/share/dbus-1/services/acpid.service</Path>
|
||||||
<Path fileType="doc">/usr/share/doc</Path>
|
<Path fileType="doc">/usr/share/doc</Path>
|
||||||
<Path fileType="man">/usr/share/man</Path>
|
<Path fileType="man">/usr/share/man</Path>
|
||||||
</Files>
|
</Files>
|
||||||
<AdditionalFiles>
|
<AdditionalFiles>
|
||||||
<AdditionalFile owner="root" permission="0755" target="/etc/acpi/actions/power.sh">acpid.power.sh</AdditionalFile>
|
<AdditionalFile owner="root" permission="0755" target="/etc/acpi/handler.sh">handler.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/anything">anything</AdditionalFile>
|
||||||
<AdditionalFile owner="root" permission="0644" target="/etc/acpi/events/video.conf">fedora/acpid.video.conf</AdditionalFile>
|
<!-- <AdditionalFile owner="root" permission="0755" target="/etc/acpi/actions/power.sh">acpid.power.sh</AdditionalFile>
|
||||||
<AdditionalFile owner="root" permission="0644" target="/etc/conf.d/acpid">fedora/acpid.sysconfig</AdditionalFile>
|
<AdditionalFile owner="root" permission="0644" target="/etc/acpi/events/power.conf">fedora/acpid.power.conf</AdditionalFile>
|
||||||
</AdditionalFiles>
|
<AdditionalFile owner="root" permission="0644" target="/etc/acpi/events/video.conf">fedora/acpid.video.conf</AdditionalFile>
|
||||||
<Provides>
|
<AdditionalFile owner="root" permission="0644" target="/etc/conf.d/acpid">fedora/acpid.sysconfig</AdditionalFile> -->
|
||||||
<COMAR script="service.py">System.Service</COMAR>
|
</AdditionalFiles>
|
||||||
</Provides>
|
<Provides>
|
||||||
</Package>
|
<COMAR script="service.py">System.Service</COMAR>
|
||||||
|
</Provides>
|
||||||
|
</Package>
|
||||||
|
|
||||||
<History>
|
<History>
|
||||||
<Update release="8">
|
<Update release="9">
|
||||||
<Date>2021-11-04</Date>
|
<Date>2022-11-10</Date>
|
||||||
<Version>2.0.33</Version>
|
<Version>2.0.34</Version>
|
||||||
<Comment>Version bump.</Comment>
|
<Comment>Version bump.</Comment>
|
||||||
<Name>Mustafa Cinasal</Name>
|
<Name>fury</Name>
|
||||||
<Email>muscnsl@gmail.com</Email>
|
<Email>uglyside@yandex.ru</Email>
|
||||||
</Update>
|
</Update>
|
||||||
<Update release="7">
|
<Update release="8">
|
||||||
<Date>2021-02-18</Date>
|
<Date>2021-11-04</Date>
|
||||||
<Version>2.0.32</Version>
|
<Version>2.0.33</Version>
|
||||||
<Comment>Rebuild.</Comment>
|
<Comment>Version bump.</Comment>
|
||||||
<Name>Mustafa Cinasal</Name>
|
<Name>Mustafa Cinasal</Name>
|
||||||
<Email>muscnsl@gmail.com</Email>
|
<Email>muscnsl@gmail.com</Email>
|
||||||
</Update>
|
</Update>
|
||||||
<Update release="6">
|
<Update release="7">
|
||||||
<Date>2020-03-02</Date>
|
<Date>2021-02-18</Date>
|
||||||
<Version>2.0.32</Version>
|
<Version>2.0.32</Version>
|
||||||
<Comment>Version bump.</Comment>
|
<Comment>Rebuild.</Comment>
|
||||||
<Name>Mustafa Cinasal</Name>
|
<Name>Mustafa Cinasal</Name>
|
||||||
<Email>muscnsl@gmail.com</Email>
|
<Email>muscnsl@gmail.com</Email>
|
||||||
</Update>
|
</Update>
|
||||||
<Update release="5">
|
<Update release="6">
|
||||||
<Date>2019-02-10</Date>
|
<Date>2020-03-02</Date>
|
||||||
<Version>2.0.31</Version>
|
<Version>2.0.32</Version>
|
||||||
<Comment>Version bump.</Comment>
|
<Comment>Version bump.</Comment>
|
||||||
<Name>Ertuğrul Erata</Name>
|
<Name>Mustafa Cinasal</Name>
|
||||||
<Email>ertugrulerata@gmail.com</Email>
|
<Email>muscnsl@gmail.com</Email>
|
||||||
</Update>
|
</Update>
|
||||||
<Update release="4">
|
<Update release="5">
|
||||||
<Date>2018-08-13</Date>
|
<Date>2019-02-10</Date>
|
||||||
<Version>2.0.28</Version>
|
<Version>2.0.31</Version>
|
||||||
<Comment>Rebuild</Comment>
|
<Comment>Version bump.</Comment>
|
||||||
<Name>Mustafa Cinasal</Name>
|
<Name>Ertuğrul Erata</Name>
|
||||||
<Email>muscnsl@gmail.com</Email>
|
<Email>ertugrulerata@gmail.com</Email>
|
||||||
</Update>
|
</Update>
|
||||||
<Update release="3">
|
<Update release="4">
|
||||||
<Date>2018-05-13</Date>
|
<Date>2018-08-13</Date>
|
||||||
<Version>2.0.28</Version>
|
<Version>2.0.28</Version>
|
||||||
<Comment>Rebuild</Comment>
|
<Comment>Rebuild</Comment>
|
||||||
<Name>Mustafa Cinasal</Name>
|
<Name>Mustafa Cinasal</Name>
|
||||||
<Email>muscnsl@gmail.com</Email>
|
<Email>muscnsl@gmail.com</Email>
|
||||||
</Update>
|
</Update>
|
||||||
<Update release="2">
|
<Update release="3">
|
||||||
<Date>2017-04-06</Date>
|
<Date>2018-05-13</Date>
|
||||||
<Version>2.0.28</Version>
|
<Version>2.0.28</Version>
|
||||||
<Comment>Version bump</Comment>
|
<Comment>Rebuild</Comment>
|
||||||
<Name>Kamil Atlı</Name>
|
<Name>Mustafa Cinasal</Name>
|
||||||
<Email>suvari@pisilinux.org</Email>
|
<Email>muscnsl@gmail.com</Email>
|
||||||
</Update>
|
</Update>
|
||||||
<Update release="1">
|
<Update release="2">
|
||||||
<Date>2016-07-02</Date>
|
<Date>2017-04-06</Date>
|
||||||
<Version>2.0.27</Version>
|
<Version>2.0.28</Version>
|
||||||
<Comment>First release</Comment>
|
<Comment>Version bump</Comment>
|
||||||
<Name>Kamil Atlı</Name>
|
<Name>Kamil Atlı</Name>
|
||||||
<Email>suvari@pisilinux.org</Email>
|
<Email>suvari@pisilinux.org</Email>
|
||||||
</Update>
|
</Update>
|
||||||
</History>
|
<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>
|
</PISI>
|
||||||
|
|||||||
Reference in New Issue
Block a user