1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 22:40:04 +08:00

Add battery status for macos && close #1008

This commit is contained in:
wsdjeg 2017-11-26 21:10:33 +08:00
parent 049e86e81d
commit 8d1067c33c

View File

@ -171,6 +171,14 @@ function! s:battery_status() abort
else
return ' ⚡' . battery . ' '
endif
elseif executable('pmset')
let battery = matchstr(system('pmset -g batt'), '\d\+%')[:-2]
if g:spacevim_statusline_unicode_symbols
return ' ' . s:ICON.battery_status(battery) . ' '
else
return ' ⚡' . battery . ' '
endif
else
return ''
endif