diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh index 7c1fe78..0acc5d6 100644 --- a/zsh/prompt.zsh +++ b/zsh/prompt.zsh @@ -57,7 +57,7 @@ zshrc_prompt_precmd() { # battery percentage, if acpi is available local battery_pct= - if type acpi &> /dev/null ; then + if [[ -d /sys/class/power_supply/BAT*(#qN) ]] && type acpi &> /dev/null; then battery_pct="$(acpi -b | cut -d, -f2 | sed -e 's/[^0-9]//g')" # colorize battery percentage or display status