mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
fix: do not show message if no battery present
This commit is contained in:
parent
08dea31e54
commit
2c4435c73e
1 changed files with 1 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
if [[ $(acpi | grep -c ^Battery) -gt 0 ]] ; then
|
||||
if [[ $(acpi 2&>/dev/null | grep -c ^Battery) -gt 0 ]] ; then
|
||||
function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
|
||||
function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
|
||||
function battery_pct_prompt() { echo "%{$fg[red]%}[$(battery_pct_remaining)]%{$reset_color%}" }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue