FreeBSD, Darwin: _lp_cpu_load improvements
FreeBSD: fixed _lp_cpu_load Darwin: optimized _lp_cpu_load Note that this change may break syntax coloring in Vim if Vim is not configured to read the file as 'bash'. Workaround: create a symbolic link with a '.bash' extension and open that file.
This commit is contained in:
parent
4492860d59
commit
e79a8707f0
@ -114,14 +114,17 @@ case "$LP_OS" in
|
|||||||
FreeBSD)
|
FreeBSD)
|
||||||
_lp_cpu_load () {
|
_lp_cpu_load () {
|
||||||
local bol load eol
|
local bol load eol
|
||||||
read bol load eol < $<( LANG=C sysctl -n vm.loadavg )
|
# If you have problems with syntax coloring due to the following
|
||||||
|
# line, do this: ln -s liquidprompt liquidprompt.bash
|
||||||
|
# and edit liquidprompt.bash
|
||||||
|
read bol load eol <<<$( LANG=C sysctl -n vm.loadavg )
|
||||||
echo "$load"
|
echo "$load"
|
||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
Darwin)
|
Darwin)
|
||||||
_lp_cpu_load () {
|
_lp_cpu_load () {
|
||||||
local load
|
local bol load eol
|
||||||
load=$(LANG=C sysctl -n vm.loadavg | awk '{print $2}')
|
read bol load eol <<<$( LANG=C sysctl -n vm.loadavg )
|
||||||
echo "$load"
|
echo "$load"
|
||||||
}
|
}
|
||||||
LP_DWIN_KERNEL_REL_VER=$(uname -r | cut -d . -f 1)
|
LP_DWIN_KERNEL_REL_VER=$(uname -r | cut -d . -f 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user