summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1b13e6b)
Avoid reading /sys file if not existent.
if has('macunix')
return match(system('pmset -g batt'), "Now drawing from 'Battery Power'") != -1
elseif has('unix')
if has('macunix')
return match(system('pmset -g batt'), "Now drawing from 'Battery Power'") != -1
elseif has('unix')
- return readfile('/sys/class/power_supply/AC/online') == ['0']
+ if filereadable('/sys/class/power_supply/AC/online')
+ return readfile('/sys/class/power_supply/AC/online') == ['0']
+ endif
endif
return 0
endfunction
endif
return 0
endfunction