diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-06-20 23:01:09 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-06-20 23:01:09 +0200 |
| commit | 581865ee0c8b8aea872f053d804a41fb5f416b17 (patch) | |
| tree | 9a2f99ea48c31629a5c3c42b0454483982cdbfed /battery-checknow | |
| parent | c5d101ab2c9db3b1a001cb56953cb90b24f8fdcf (diff) | |
| download | scripts-581865ee0c8b8aea872f053d804a41fb5f416b17.tar.gz scripts-581865ee0c8b8aea872f053d804a41fb5f416b17.zip | |
Various shellcheck fixes (www.shellcheck.net)
Diffstat (limited to '')
| -rwxr-xr-x | battery-checknow | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/battery-checknow b/battery-checknow index bde1ae2..7d16346 100755 --- a/battery-checknow +++ b/battery-checknow | |||
| @@ -12,10 +12,10 @@ new=$(battery-status) | |||
| 12 | level=$(echo "$new" | sed 's/%.*//') | 12 | level=$(echo "$new" | sed 's/%.*//') |
| 13 | status=$(echo "$new" | awk '{print $2}') | 13 | status=$(echo "$new" | awk '{print $2}') |
| 14 | 14 | ||
| 15 | [ "$status" = "Discharging" ] && [ $level -le $low ] && status="Low" | 15 | [ "$status" = "Discharging" ] && [ "$level" -le "$low" ] && status="Low" |
| 16 | [ "$status" = "Discharging" ] && [ $level -le $crit ] && status="Critical" | 16 | [ "$status" = "Discharging" ] && [ "$level" -le "$crit" ] && status="Critical" |
| 17 | 17 | ||
| 18 | if [ "$status" != "$(cat $file)" ] || [ "$status" = "Critical" ]; then | 18 | if [ "$status" != "$(cat "$file")" ] || [ "$status" = "Critical" ]; then |
| 19 | $notify "Battery" "$(battery-status)" | 19 | $notify "Battery" "$(battery-status)" |
| 20 | fi | 20 | fi |
| 21 | 21 | ||
