all repos — dotfiles @ 87fb6579cde259fcc7426ed8b663eb8c0cd4c8af

linux dotfiles

add battery low notification
Prithu Goswami prithugoswami524@gmail.com
Mon, 23 Dec 2019 09:57:54 +0530
commit

87fb6579cde259fcc7426ed8b663eb8c0cd4c8af

parent

6bd623b9f54730a79d95d42125850cc6b252ffef

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M i3blocks/batteryi3blocks/battery

@@ -1,6 +1,7 @@

#!/bin/sh percent=$(acpi | cut -d ' ' -f4 | tail -1 | tr -d ',') state=$(acpi | cut -d ' ' -f3 | tail -1 | tr -d ',') +percent_no=$(echo -n $percent | tr -d '%') case $state in Charging)

@@ -9,14 +10,13 @@ ;;

*) #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 + [ $percent_no -le 30 ] && notify-send -i battery-low -u critical "Battery Low" ;; esac - echo -e "$symbol$percent" -awk -v percent=$percent ' +awk -v percent=$percent_no ' BEGIN { if (percent <= 30) { print "#FF0000";