aboutsummaryrefslogtreecommitdiff
path: root/src/usr/local/bin/bat-led-set
blob: e88fec4ddc9034faaeabc18490dc59d749dbfa01 (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 && test $POWER_SUPPLY_STATUS = Discharging"; then
	export OUT=1
else
	export OUT=0
fi

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