From 15575bc6b5baba8e0817ebef714daef175bf874c Mon Sep 17 00:00:00 2001 From: hi80482 <66435094+hi80482@users.noreply.github.com> Date: Fri, 3 Jul 2020 16:39:50 +0800 Subject: [PATCH] Update 00_lowpower.sh Sync Ver.200626 --- sys.py/gsnotify/Jobs/00_lowpower.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys.py/gsnotify/Jobs/00_lowpower.sh b/sys.py/gsnotify/Jobs/00_lowpower.sh index 33ff5ab..adb92b8 100755 --- a/sys.py/gsnotify/Jobs/00_lowpower.sh +++ b/sys.py/gsnotify/Jobs/00_lowpower.sh @@ -1,15 +1,15 @@ #!/bin/bash -BAT_PNT=`upower -i $(upower -e | grep 'battery') | grep -E "state|to\ full|percentage" | awk '/perc/{print $2}' | cut -d % -f1 ` +BAT_PNT=$(upower -i "$(upower -e | grep 'battery')" | grep -E "state|to\ full|percentage" | awk '/perc/{print $2}' | cut -d % -f1 ) if [ "$BAT_PNT" -lt "20" ]; then - if [ "$BAT_PNT" -lt "5" ]; then - echo '{"type":"once","content":"Low Battery: 5% of battery remaining"}' - elif [ "$BAT_PNT" -lt "10" ]; then - echo '{"type":"once","content":"Low Battery: 10% of battery remaining"}' - fi + if [ "$BAT_PNT" -lt "5" ]; then + echo '{"type":"once","content":"Low Battery: 5% of battery remaining"}' + elif [ "$BAT_PNT" -lt "10" ]; then + echo '{"type":"once","content":"Low Battery: 10% of battery remaining"}' + fi else - echo $BAT_PNT + echo "$BAT_PNT" fi