(Scripts)~battery script now uses just grep time

This is incase it is charging.
This commit is contained in:
2022-09-18 11:59:00 +00:00
parent f3c26def38
commit d26f484d46

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env bash
capacity=$(cat /sys/class/power_supply/BAT0/capacity) || break
status=$(cat /sys/class/power_supply/BAT0/status)
time_left=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "time to empty" | sed 's/.*://' | xargs echo $1)
time_left=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "time" | sed 's/.*://' | xargs echo $1)
if [[ $status == "Charging" ]]
then
status=""
status=""
else
if [[ $capacity -ge 75 ]]
then