diff options
author | u <u@billy> | 2023-04-09 10:46:06 -0400 |
---|---|---|
committer | u <u@billy> | 2023-04-09 10:46:06 -0400 |
commit | e0a8c461c7a8417a0de66a2b2a6579cccd02d1e3 (patch) | |
tree | cadba1e38c80323638557fc61b3d463f19b681e1 | |
parent | 82f4d2368a90d8b271fdafc0a3ccc9dc078c4e7d (diff) |
use bash builtin sleep
-rwxr-xr-x | go.sh | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/bash |
2 | capacity_threshold=90 | 2 | capacity_threshold=50 |
3 | 3 | ||
4 | battery_dir=/sys/class/power_supply/BAT0 | 4 | battery_dir=/sys/class/power_supply/BAT0 |
5 | status_file=$battery_dir/status | 5 | status_file=$battery_dir/status |
@@ -43,6 +43,13 @@ go() | |||
43 | 43 | ||
44 | main() | 44 | main() |
45 | { | 45 | { |
46 | if [ -e /usr/lib/bash/sleep ] | ||
47 | then | ||
48 | enable -f /usr/lib/bash/sleep sleep | ||
49 | else | ||
50 | echo 'Warning: not found: /usr/lib/bash/sleep (try: "sudo apt install bash-builtins")' >&2 | ||
51 | fi | ||
52 | |||
46 | while true | 53 | while true |
47 | do | 54 | do |
48 | go | 55 | go |