aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/etc/udev/rules.d/99-lowbat.rules4
-rwxr-xr-xsrc/usr/local/bin/bat-led-set3
2 files changed, 7 insertions, 0 deletions
diff --git a/src/etc/udev/rules.d/99-lowbat.rules b/src/etc/udev/rules.d/99-lowbat.rules
index 1d322e3..ecb80b5 100644
--- a/src/etc/udev/rules.d/99-lowbat.rules
+++ b/src/etc/udev/rules.d/99-lowbat.rules
@@ -1 +1,5 @@
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-1]", RUN+="/usr/bin/systemctl hybrid-sleep"
+
+SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/local/bin/bat-led-set 1"
+SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[1-9][0-9]|[6-9]", RUN+="/usr/local/bin/bat-led-set 0"
+SUBSYSTEM=="power_supply", ATTR{status}=="Charging", RUN+="/usr/local/bin/bat-led-set 0"
diff --git a/src/usr/local/bin/bat-led-set b/src/usr/local/bin/bat-led-set
new file mode 100755
index 0000000..8a7397e
--- /dev/null
+++ b/src/usr/local/bin/bat-led-set
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+echo $1 >/sys/class/leds/input3::capslock/brightness