]> git.armaanb.net Git - bin.git/commitdiff
Status: switch from upower to acpi
authorArmaan Bhojwani <me@armaanb.net>
Fri, 29 Jan 2021 02:33:02 +0000 (21:33 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Fri, 29 Jan 2021 02:33:02 +0000 (21:33 -0500)
Instead of parsing the output of `upower --dump` to get battery info,
which left odd whitespace, just tail the battery number off of `acpi`

status

diff --git a/status b/status
index e5e5138fbdd3f449cedf39237dc6d725f39ae318..46d9b639e3368c0f503a8313109ffd175e09913b 100755 (executable)
--- a/status
+++ b/status
@@ -6,14 +6,7 @@ time_set() {
 }
 
 power_set() {
-  echo -n "$(upower -d | grep percentage | tail -c 5)"
-  if [[ $(upower -d | grep "discharging") ]]; then
-    echo -n " battery,"
-    echo "$(upower -d | grep "time to empty" | tail -c 15) remaining"
-  else
-    echo -n " battery,"
-    echo "$(upower -d | grep "time to full" | tail -c 15) until charged"
-  fi
+  echo $(acpi | tail -c +12)
 }
 
 volume_set() {