summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgo.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/go.sh b/go.sh
index 686127f..d68c002 100755
--- a/go.sh
+++ b/go.sh
@@ -27,14 +27,14 @@ go()
27 return 1 ;; 27 return 1 ;;
28 esac 28 esac
29 29
30 read status < "$status_file" || return
31
30 if [ -t 2 ] 32 if [ -t 2 ]
31 then 33 then
32 printf ' %.2d%% \r' "$capacity" >&2 34 printf '\r %20s %.2d%%\r' "$status" "$capacity" >&2
33 fi 35 fi
34 36
35 read status < "$status_file" || return
36 [ "$status" = Discharging ] || return 0 37 [ "$status" = Discharging ] || return 0
37
38 if [ "$capacity" -lt "$capacity_threshold" ] 38 if [ "$capacity" -lt "$capacity_threshold" ]
39 then 39 then
40 systemctl suspend 40 systemctl suspend