mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 13:41:56 +00:00
Change load segment to accept an optional root prefix for testability
This commit is contained in:
parent
1cf68e418c
commit
04168cc5c0
1 changed files with 2 additions and 1 deletions
|
@ -1132,6 +1132,7 @@ prompt_laravel_version() {
|
||||||
# Segment to display load
|
# Segment to display load
|
||||||
set_default POWERLEVEL9K_LOAD_WHICH 5
|
set_default POWERLEVEL9K_LOAD_WHICH 5
|
||||||
prompt_load() {
|
prompt_load() {
|
||||||
|
local ROOT_PREFIX="${4}"
|
||||||
# The load segment can have three different states
|
# The load segment can have three different states
|
||||||
local current_state="unknown"
|
local current_state="unknown"
|
||||||
local load_select=2
|
local load_select=2
|
||||||
|
@ -1167,7 +1168,7 @@ prompt_load() {
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
load_avg=$(cut -d" " -f${load_select} /proc/loadavg)
|
load_avg=$(cut -d" " -f${load_select} ${ROOT_PREFIX}/proc/loadavg)
|
||||||
cores=$(nproc)
|
cores=$(nproc)
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue