all repos — dotfiles @ 8d840f5a83a290c1082baf019f51b0da6131cc28

linux dotfiles

add notification for low battery
Prithu Goswami prithugoswami524@gmail.com
Sat, 21 Dec 2019 09:33:08 +0530
commit

8d840f5a83a290c1082baf019f51b0da6131cc28

parent

aa399c0f684edb45cf132b449f1b83525ecbdd3b

1 files changed, 11 insertions(+), 0 deletions(-)

jump to
M i3blocks/batteryi3blocks/battery

@@ -9,7 +9,18 @@ ;;

*) #symbol="<span font='Icons 11'>\uf213</span>" #symbol="<span font='Material Design Icons'>\uf079</span>" + [ $percent -le 30 ] && notify-send -u critical "Battery Low" -i battery-low ;; esac + echo -e "$symbol$percent" + +awk -v percent=$percent ' + BEGIN { + if (percent <= 30) { + print "#FF0000"; + exit 33; + } + } +'