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:
parent
049e86e81d
commit
8d1067c33c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user