From: Armaan Bhojwani Date: Fri, 29 Jan 2021 02:33:02 +0000 (-0500) Subject: Status: switch from upower to acpi X-Git-Tag: v0.0.1~52 X-Git-Url: https://git.armaanb.net/?p=bin.git;a=commitdiff_plain;h=25ba57f5ba65e5d403afba523d5687eda93d7214 Status: switch from upower to acpi Instead of parsing the output of `upower --dump` to get battery info, which left odd whitespace, just tail the battery number off of `acpi` --- diff --git a/status b/status index e5e5138..46d9b63 100755 --- 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() {