summarylogtreecommitdiffstats
path: root/90-intel-lpmd.rules
diff options
context:
space:
mode:
Diffstat (limited to '90-intel-lpmd.rules')
-rw-r--r--90-intel-lpmd.rules6
1 files changed, 6 insertions, 0 deletions
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"