summaryrefslogtreecommitdiff
path: root/battery
diff options
context:
space:
mode:
authortslil clingman <>2021-01-24 20:23:19 -0500
committertslil clingman <>2021-01-24 20:23:19 -0500
commit3c79bbc4529f62d462f6807f354b6b4c5e3477e6 (patch)
tree3df4f41d1a19eb0e48e60d75f580ff1d8d47b093 /battery
parent515c31a1f08d7ba500bf7261d7018a250dfd9779 (diff)
parent92f24df41be941d407965368a9c84b7f061fddb8 (diff)
Merge branch 'master' of git.sr.ht:~tslil/scripts
Diffstat (limited to 'battery')
-rwxr-xr-xbattery12
1 files changed, 5 insertions, 7 deletions
diff --git a/battery b/battery
index 29189ae..1e7a7da 100755
--- a/battery
+++ b/battery
@@ -1,9 +1,7 @@
#!/bin/sh
report=$(acpi | tr -d ',')
-echo $report | grep -qv Unknown
-if [ "$?" = "0" ]; then
- status=$(echo $report | cut -d\ -f 3 | cut -b 1)
- perc=$(echo $report | cut -d\ -f 4)
- time=$(echo $report | cut -d\ -f 5 | sed 's/\([0-9]*\):\([0-9]*\).*/\1h\2m/')
- echo $status$perc $time
-fi
+status=$(echo $report | cut -d\ -f 3 | cut -b 1)
+perc=$(echo $report | cut -d\ -f 4)
+time=$(echo $report | cut -d\ -f 5 | sed 's/\([0-9]*\):\([0-9]*\).*/\1h\2m/')
+echo $status$perc $time
+