From a56eac7a71a774a4d97bb9456f36b8eb495329d5 Mon Sep 17 00:00:00 2001 From: Hong Date: Mon, 10 Oct 2016 13:24:30 -0700 Subject: Use OSTYPE instead of uname whenever possible for better speed. (#5496) --- plugins/battery/battery.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/battery/battery.plugin.zsh') diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 0bb9e77f0..da229cf35 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -64,7 +64,7 @@ if [[ "$OSTYPE" = darwin* ]] ; then [[ $(ioreg -rc "AppleSmartBattery"| grep '^.*"IsCharging"\ =\ ' | sed -e 's/^.*"IsCharging"\ =\ //') == "Yes" ]] } -elif [[ $(uname) == "Linux" ]] ; then +elif [[ "$OSTYPE" = linux* ]] ; then function battery_is_charging() { ! [[ $(acpi 2>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] -- cgit v1.2.3-70-g09d2