mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-23 08:39:51 +00:00
Use OSTYPE instead of uname whenever possible for better speed. (#5496)
This commit is contained in:
@@ -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 ]]
|
||||
|
||||
Reference in New Issue
Block a user