aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-07-18 23:20:16 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-07-18 23:20:16 +0300
commit04168cc5c012f9ca5759bf277a2e0d44a145c520 (patch)
tree6de88d34420c6bfc528335f40b5911cfc88095ae /powerlevel9k.zsh-theme
parent1cf68e418c184023c717b8a6a71d30168936adf4 (diff)
Change load segment to accept an optional root prefix for testability
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme3
1 files changed, 2 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 1c9194f7..1983b031 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1132,6 +1132,7 @@ prompt_laravel_version() {
# Segment to display load
set_default POWERLEVEL9K_LOAD_WHICH 5
prompt_load() {
+ local ROOT_PREFIX="${4}"
# The load segment can have three different states
local current_state="unknown"
local load_select=2
@@ -1167,7 +1168,7 @@ prompt_load() {
fi
;;
*)
- load_avg=$(cut -d" " -f${load_select} /proc/loadavg)
+ load_avg=$(cut -d" " -f${load_select} ${ROOT_PREFIX}/proc/loadavg)
cores=$(nproc)
esac