aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme5
1 files changed, 3 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 1983b031..2b68b6a4 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1241,6 +1241,7 @@ prompt_php_version() {
################################################################
# Segment to display free RAM and used Swap
prompt_ram() {
+ local ROOT_PREFIX="${4}"
local base=''
local ramfree=0
if [[ "$OS" == "OSX" ]]; then
@@ -1252,9 +1253,9 @@ prompt_ram() {
ramfree=$(( ramfree * 4096 ))
else
if [[ "$OS" == "BSD" ]]; then
- ramfree=$(grep 'avail memory' /var/run/dmesg.boot | awk '{print $4}')
+ ramfree=$(grep 'avail memory' ${ROOT_PREFIX}/var/run/dmesg.boot | awk '{print $4}')
else
- ramfree=$(grep -o -E "MemAvailable:\s+[0-9]+" /proc/meminfo | grep -o "[0-9]*")
+ ramfree=$(grep -o -E "MemAvailable:\s+[0-9]+" ${ROOT_PREFIX}/proc/meminfo | grep -o -E "[0-9]+")
base='K'
fi
fi