aboutsummaryrefslogtreecommitdiffstats
path: root/hyperterm/themes/simple.sh
diff options
context:
space:
mode:
Diffstat (limited to 'hyperterm/themes/simple.sh')
-rw-r--r--hyperterm/themes/simple.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/hyperterm/themes/simple.sh b/hyperterm/themes/simple.sh
index afba275..e4902c2 100644
--- a/hyperterm/themes/simple.sh
+++ b/hyperterm/themes/simple.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# shellcheck disable=SC2034,SC2154
unset simple
@@ -9,15 +10,22 @@ __time_out_command() {
awk '{ print $1 }' /proc/loadavg
}
-: "${simple:=\n\
+PROMPT_COMMAND='
+ last_status=$?
+ ps1_status="$(exitstatus "$last_status")"
+ ps1_load="$(__time_out_command)"
+ ps1_git="$(__prompt_git)"
+'
+
+simple="\n\
\[${RESET}\]\
\[${BOLD}${GREY}\]\
-\$(exitstatus)\[$RESET\] \
+\${ps1_status}\[$RESET\] \
\[${BOLD}${GREY}\]\
-\$(__time_out_command)\[$RESET\] \
+\${ps1_load}\[$RESET\] \
\[${BOLD}${WHITE}\]\W\[$RESET\]\
-\$(__prompt_git)\n\
-\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]}"
+\${ps1_git}\n\
+\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]"
unset _psi
: "${_psi:=\[${BOLD}${CYAN}\]=>\[$RESET\] }"