aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/etc/udev/rules.d/99-lowbat.rules2
-rwxr-xr-xsrc/usr/local/bin/bat-led-set2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/etc/udev/rules.d/99-lowbat.rules b/src/etc/udev/rules.d/99-lowbat.rules
index 0d90607..c5a9b76 100644
--- a/src/etc/udev/rules.d/99-lowbat.rules
+++ b/src/etc/udev/rules.d/99-lowbat.rules
@@ -1,4 +1,4 @@
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-1]", RUN+="/usr/bin/systemctl hybrid-sleep"
-SUBSYSTEM=="power_supply", ATTR{manufacturer}=="Celxpert", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/local/bin/bat-led-set 1"
+SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/local/bin/bat-led-set 1"
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
index 8a7397e..1c59a05 100755
--- a/src/usr/local/bin/bat-led-set
+++ b/src/usr/local/bin/bat-led-set
@@ -1,3 +1,3 @@
#!/bin/sh
-echo $1 >/sys/class/leds/input3::capslock/brightness
+cat /sys/class/power_supply/BAT*/capacity | xargs -n1 test 5 -ge && echo $1 >/sys/class/leds/input3::capslock/brightness