summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--90-intel-lpmd.rules6
-rw-r--r--PKGBUILD9
3 files changed, 15 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1fd2be56491b..8416beb63223 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = intel-lpmd
pkgdesc = Intel Low Power Mode Daemon
pkgver = 0.0.3
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/intel/intel-lpmd
arch = x86_64
license = GPL-2.0-or-later
@@ -14,6 +14,8 @@ pkgbase = intel-lpmd
depends = libnl
depends = systemd-libs
source = git+https://github.com/intel/intel-lpmd.git#tag=v0.0.3
+ source = 90-intel-lpmd.rules
sha256sums = SKIP
+ sha256sums = f40f544c913ea3441477bb128b5fcd5a70aaa4c62690a2a0fb5b814ffad8d6a9
pkgname = intel-lpmd
diff --git a/90-intel-lpmd.rules b/90-intel-lpmd.rules
new file mode 100644
index 000000000000..2c6e5f8f60ed
--- /dev/null
+++ b/90-intel-lpmd.rules
@@ -0,0 +1,6 @@
+# Turn off intel_lpmd when running on power,
+# and set to auto when running on battery.
+# Rules thanks to
+# https://github.com/intel/intel-lpmd/issues/24#issuecomment-1973348960
+ACTION=="change", SUBSYSTEM=="power_supply", KERNEL!="hidpp_battery*", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/usr/bin/intel_lpmd_control AUTO"
+ACTION=="change", SUBSYSTEM=="power_supply", KERNEL!="hidpp_battery*", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/usr/bin/intel_lpmd_control OFF"
diff --git a/PKGBUILD b/PKGBUILD
index 03077d86dbc4..e6f6ba160aa9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,15 +1,17 @@
# Maintainer: Norbert Preining <norbert@preining.info>
pkgname=intel-lpmd
pkgver=0.0.3
-pkgrel=1
+pkgrel=2
pkgdesc="Intel Low Power Mode Daemon"
arch=('x86_64')
url="https://github.com/intel/$pkgname"
license=('GPL-2.0-or-later')
makedepends=('git' 'automake' 'autoconf-archive' 'gtk-doc')
depends=('dbus-glib' 'libxml2' 'libnl' 'systemd-libs')
-source=(git+${url}.git#tag=v${pkgver})
-sha256sums=('SKIP')
+source=(git+${url}.git#tag=v${pkgver} 90-intel-lpmd.rules)
+sha256sums=('SKIP'
+ 'f40f544c913ea3441477bb128b5fcd5a70aaa4c62690a2a0fb5b814ffad8d6a9'
+)
prepare() {
cd "$pkgname"
@@ -24,4 +26,5 @@ build() {
package() {
cd "$pkgname"
DESTDIR="$pkgdir" make install
+ install -Dm 644 -t "${pkgdir}/usr/lib/udev/rules.d" "$srcdir/90-intel-lpmd.rules"
}