blob: 15ffb99857831ef72ef83440a05ee74cabcc16ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/bin/sh
if [ -f /sys/class/power_supply/sony_controller_battery_*/capacity ]; then
percentage=$(cat /sys/class/power_supply/sony_controller_battery_*/capacity)
if [ percentage -lt 40 ]; then
printf "<span color=\"#b2872f\">%s%%</span>" "$percentage"
exit
fi
if [ percentage -lt 20 ]; then
printf "<span color=\"#b73030\">%s%%</span>" "$percentage"
exit
fi
printf "<span color=\"#5b8277\">%s%%</span>" "$percentage"
fi
|