Fix battery charging state
This commit is contained in:
parent
bd39d8af10
commit
727e03be6e
1 changed files with 2 additions and 2 deletions
|
@ -5,10 +5,10 @@ icon="${LABEL_100}"
|
|||
percent="$(upower -d | awk '/percentage/ {print $2}' | head -n 1 | cut -d% -f1)"
|
||||
remaining="$(upower -d | awk -F: '/time to empty/ {print $2}' | awk '{print $1,$2}' | head -n 1)"
|
||||
|
||||
if upower -d | grep '\bcharging\b' >/dev/null 2>&1; then
|
||||
if upower -d | grep -E 'state.+\bcharging\b' >/dev/null 2>&1; then
|
||||
icon="${LABEL_CHARGING}"
|
||||
echo "${icon} ${percent}%"
|
||||
elif upower -d | grep '\bdischarging\b' >/dev/null 2>&1; then
|
||||
elif upower -d | grep -E 'state.+\bdischarging\b' >/dev/null 2>&1; then
|
||||
if [ "$percent" -lt 10 ]; then
|
||||
icon="${LABEL_10}"
|
||||
elif [ "$percent" -lt 20 ]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue