diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 8f398cfb..8f10763c 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -70,6 +70,10 @@ elif [[ "$OSTYPE" = linux* ]] ; then ! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] } + function plugged_in() { + ! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] + } + function battery_pct() { if (( $+commands[acpi] )) ; then echo "$(acpi 2>/dev/null | cut -f2 -d ',' | tr -cd '[:digit:]')"