mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
fixed battery.plugin when acpi writes to stderr
This commit is contained in:
parent
acd6a14a2f
commit
3bfcb16c08
1 changed files with 2 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ elif [[ $(uname) == "Linux" ]] ; then
|
|||
|
||||
function battery_pct() {
|
||||
if (( $+commands[acpi] )) ; then
|
||||
echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')"
|
||||
echo "$(acpi 2&>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]')"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ elif [[ $(uname) == "Linux" ]] ; then
|
|||
|
||||
function battery_time_remaining() {
|
||||
if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
|
||||
echo $(acpi | cut -f3 -d ',')
|
||||
echo $(acpi 2&>/dev/null | cut -f3 -d ',')
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue