aboutsummaryrefslogtreecommitdiffstats
path: root/hyperterm/themes
diff options
context:
space:
mode:
Diffstat (limited to 'hyperterm/themes')
-rw-r--r--hyperterm/themes/default.sh14
-rw-r--r--hyperterm/themes/joy.sh15
-rw-r--r--hyperterm/themes/light_theme.sh15
-rw-r--r--hyperterm/themes/minterm.sh18
-rw-r--r--hyperterm/themes/pure.sh18
-rw-r--r--hyperterm/themes/simple.sh18
-rw-r--r--hyperterm/themes/special.sh21
7 files changed, 83 insertions, 36 deletions
diff --git a/hyperterm/themes/default.sh b/hyperterm/themes/default.sh
index 8d2f026..27512bd 100644
--- a/hyperterm/themes/default.sh
+++ b/hyperterm/themes/default.sh
@@ -1,11 +1,17 @@
#!/bin/bash
-# shellcheck disable=SC1117
+# shellcheck disable=SC1117,SC2034,SC2154
unset default
# Import colors
_colors_bash "$@"
+PROMPT_COMMAND='
+ last_status=$?
+ ps1_status="$(exitstatus "$last_status")"
+ ps1_git="$(__prompt_git)"
+'
+
default=("\n\
\[$RESET\]\
\[${BOLD}${YELLOW}\][ \u \
@@ -13,11 +19,9 @@ default=("\n\
\[${BOLD}${RED}\] \D{%I:%M%p} ]\n\
\[$RESET\]\
\[${BOLD}${WHITE}\][\$PWD]\[$RESET\] \
-\$(exitstatus)\[$RESET\]\
-\$(__prompt_git)\
+\${ps1_status}\[$RESET\]\
+\${ps1_git}\
\n\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]")
-export default
-
unset _psi
: "${_psi:=\[${BOLD}${CYAN}\]=>\[$RESET\] }"
diff --git a/hyperterm/themes/joy.sh b/hyperterm/themes/joy.sh
index 0f5e8ee..54e29f6 100644
--- a/hyperterm/themes/joy.sh
+++ b/hyperterm/themes/joy.sh
@@ -1,11 +1,18 @@
#!/bin/bash
+# shellcheck disable=SC2034,SC2154
unset joy
# Import colors
_colors_bash "$@"
-: "${joy:=\n\
+PROMPT_COMMAND='
+ last_status=$?
+ ps1_status="$(exitstatus "$last_status")"
+ ps1_git="$(__prompt_git)"
+'
+
+joy="\n\
\[${BOLD}${CYAN}\]\342\224\214\342\224\200[\
\[${BOLD}${YELLOW}\]\u\
\[${BOLD}${CYAN}\]@\
@@ -15,15 +22,15 @@ _colors_bash "$@"
\[${RESET}\]\w\
\[${BOLD}${CYAN}\]]\
\342\224\200\
-\$(exitstatus)\
+\${ps1_status}\
\[${BOLD}${CYAN}\]\
\342\224\200\
-\$(__prompt_git)\
+\${ps1_git}\
\[${BOLD}${CYAN}\]\342\224\200[\
\[${RESET}\]\t\
\[${BOLD}${CYAN}\]]\n\
\[${BOLD}${CYAN}\]\342\224\224\342\224\200\342\224\200\342\225\274\
-\[${BOLD}${GREEN}\] $SYMBOL \[$RESET\]}"
+\[${BOLD}${GREEN}\] $SYMBOL \[$RESET\]"
unset _psi
: "${_psi:=\[${BOLD}${CYAN}\]=>\[$RESET\] }"
diff --git a/hyperterm/themes/light_theme.sh b/hyperterm/themes/light_theme.sh
index c269aaa..5fadaa0 100644
--- a/hyperterm/themes/light_theme.sh
+++ b/hyperterm/themes/light_theme.sh
@@ -1,20 +1,27 @@
#!/bin/bash
+# shellcheck disable=SC2034,SC2154
unset light_theme
# Import colors
_colors_bash "$@"
-: "${light_theme:=\n\
+PROMPT_COMMAND='
+ last_status=$?
+ ps1_status="$(exitstatus "$last_status")"
+ ps1_git="$(__prompt_git)"
+'
+
+light_theme="\n\
\[$RESET\]\
\[${BOLD}${CYAN}\]┌─\[$RESET\]\
\[${BOLD}${YELLOW}\]\u\[$RESET\]\
\[${BOLD}${CYAN}\]@\[$RESET\]\
\[${BOLD}${GREY}\]\h\[$RESET\] \
-\$(exitstatus)\[$RESET\] \
+\${ps1_status}\[$RESET\] \
\[${BOLD}${WHITE}\][\$PWD]\
-\$(__prompt_git)\
-\n\[${BOLD}${CYAN}\]╰─➤\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]}"
+\${ps1_git}\
+\n\[${BOLD}${CYAN}\]╰─➤\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]"
unset _psi
: "${_psi:=\[${BOLD}${CYAN}\]=>\[$RESET\] }"
diff --git a/hyperterm/themes/minterm.sh b/hyperterm/themes/minterm.sh
index 139094a..07dfa04 100644
--- a/hyperterm/themes/minterm.sh
+++ b/hyperterm/themes/minterm.sh
@@ -1,21 +1,29 @@
#!/bin/bash
+# shellcheck disable=SC2034,SC2154
unset minterm
# Import colors
_colors_bash "$@"
-: "${minterm:=\n\
+PROMPT_COMMAND='
+ last_status=$?
+ ps1_status="$(exitstatus "$last_status")"
+ ps1_git="$(__prompt_git)"
+ ps1_time="$(printf "%b%s" "${BOLD}${GREY}" "$(date +%H:%M)")"
+'
+
+minterm="\n\
\[${BOLD}${CYAN}\]┌─\
\[${BOLD}${YELLOW}\]\u\
\[${BOLD}${CYAN}\]@\
\[${BOLD}${GREY}\]\h\[$RESET\] \
-\$(exitstatus)\[$RESET\] \
+\${ps1_status}\[$RESET\] \
\[${BOLD}${WHITE}\][\$PWD]\
-\$(__prompt_git)\n\
+\${ps1_git}\n\
\[${BOLD}${CYAN}\]╰─➤\[$RESET\] \
-\$( echo -n \"\[${BOLD}${GREY}\]\$(date +%H:%M)\" )\[$RESET\] \
-\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]}"
+\${ps1_time}\[$RESET\] \
+\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]"
unset _psi
: "${_psi:=\[${BOLD}${CYAN}\]=>\[$RESET\] }"
diff --git a/hyperterm/themes/pure.sh b/hyperterm/themes/pure.sh
index 62958de..ab8f1b4 100644
--- a/hyperterm/themes/pure.sh
+++ b/hyperterm/themes/pure.sh
@@ -1,19 +1,27 @@
#!/bin/bash
+# shellcheck disable=SC2034,SC2154
unset pure
# Import colors
_colors_bash "$@"
-: "${pure:=\
+PROMPT_COMMAND='
+ last_status=$?
+ ps1_status="$(exitstatus "$last_status")"
+ ps1_git="$(__prompt_git)"
+ ps1_time="$(printf "%b%s" "${BOLD}${GREY}" "$(date +%H:%M)")"
+'
+
+pure="\
\[${BOLD}${GREEN}\]\u\[$RESET\] \
\[${BOLD}${YELLOW}\][\
\[${BOLD}${RED}\]\w\
\[${BOLD}${YELLOW}\]]\[$RESET\] \
-\$(exitstatus)\[$RESET\] \
-\[${BOLD}${BLUE}\](\$(date +%H:%M:%S))\
-\$(__prompt_git)\
-\n\[${BOLD}${CYAN}\]$SYMBOL \[$RESET\]}"
+\${ps1_status}\[$RESET\] \
+\${ps1_time}\
+\${ps1_git}\
+\n\[${BOLD}${CYAN}\]$SYMBOL \[$RESET\]"
unset _psi
: "${_psi:=\[${BOLD}${CYAN}\]=>\[$RESET\] }"
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\] }"
diff --git a/hyperterm/themes/special.sh b/hyperterm/themes/special.sh
index fd58b1e..7ad71f8 100644
--- a/hyperterm/themes/special.sh
+++ b/hyperterm/themes/special.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# shellcheck disable=SC1117
+# shellcheck disable=SC1117,SC2034,SC2154
unset special
@@ -17,19 +17,24 @@ _prompt_local_name() {
esac
}
-special=("\n\
+PROMPT_COMMAND='
+ last_status=$?
+ ps1_status="$(exitstatus "$last_status")"
+ ps1_loc="$(_prompt_local_name)"
+ ps1_git="$(__prompt_git)"
+'
+
+special="\n\
\[$RESET\]\
-\[${BOLD}${YELLOW}\][$(_prompt_local_name)\
+\[${BOLD}${YELLOW}\][\${ps1_loc}\
\[$RESET\] \[${BOLD}${GREY}\]\w\
\[${BOLD}${YELLOW}\]]\[$RESET\] \
\[${BOLD}${CYAN}\]hist:\!\[$RESET\]\n\
\[${BOLD}${GREY}\]\
\D{%Y-%m-%d}@\D{%I:%M%p}\[$RESET\] \
-\$(exitstatus)\[$RESET\]\
-\$(__prompt_git)\n\
-\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]")
-
-export special
+\${ps1_status}\[$RESET\]\
+\${ps1_git}\n\
+\[${BOLD}${GREEN}\]$SYMBOL \[$RESET\]"
unset _psi
: "${_psi:=\[${BOLD}${CYAN}\]=>\[$RESET\] }"