summaryrefslogtreecommitdiff
path: root/i3blocks-battery.sh
blob: af2d37fe561fca6d90892d5995e16898d3a7b834 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
icon_high=󰁹
icon_low=󰁾
icon_crit=󱃍
icon_charging=󰂄

status=$(apm -b)
level=$(apm -l)

[ $status -eq 0 ] && printf "%s" $icon_high
[ $status -eq 1 ] && printf "%s" $icon_low
[ $status -eq 2 ] && printf "%s" $icon_crit
[ $status -eq 3 ] && printf "%s" $icon_charging

printf " %s%%\n" $level