summaryrefslogblamecommitdiff
path: root/i3blocks-battery.sh
blob: c37c7a257e961ad8f59a94cbd0ee3b93fdf01380 (plain) (tree)
1
2
3
4
5
6
7
8
9
         



                  
 

                
 

                                           
                                                                                   
                                               
 
                      
#!/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 && notify-send "Battery critically low"
[ $status -eq 3 ] && printf "%s" $icon_charging

printf "%s%%\n" $level