mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
commit
e8b85f9202
1 changed files with 7 additions and 3 deletions
|
@ -18,11 +18,15 @@ if [[ $(uname) == "Darwin" ]] ; then
|
|||
echo $i
|
||||
}
|
||||
|
||||
function plugged_in() {
|
||||
[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ Yes') -eq 1 ]
|
||||
}
|
||||
|
||||
function battery_pct_remaining() {
|
||||
if [[ $(ioreg -rc AppleSmartBattery | grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]] ; then
|
||||
battery_pct
|
||||
else
|
||||
if plugged_in ; then
|
||||
echo "External Power"
|
||||
else
|
||||
battery_pct
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue