aboutsummaryrefslogtreecommitdiff
path: root/src/usr/local/bin/bat-led-set
blob: 22a2b6a9526b0af7f156ba85882124161fd97fb2 (plain)
1
2
3
4
5
6
7
8
9
#!/bin/sh

if sh -c "cat /sys/class/power_supply/BAT*/capacity | xargs -n1 test 5 -ge"; then
	export OUT=1
else
	export OUT=0
fi

[ $1 = $OUT ] && echo $OUT >/sys/class/leds/input3::capslock/brightness