diff options
-rw-r--r-- | hyperterm/core/status.sh | 21 | ||||
-rw-r--r-- | hyperterm/hyperterm.sha512 | 16 | ||||
-rw-r--r-- | hyperterm/themes/default.sh | 14 | ||||
-rw-r--r-- | hyperterm/themes/joy.sh | 15 | ||||
-rw-r--r-- | hyperterm/themes/light_theme.sh | 15 | ||||
-rw-r--r-- | hyperterm/themes/minterm.sh | 18 | ||||
-rw-r--r-- | hyperterm/themes/pure.sh | 18 | ||||
-rw-r--r-- | hyperterm/themes/simple.sh | 18 | ||||
-rw-r--r-- | hyperterm/themes/special.sh | 21 |
9 files changed, 96 insertions, 60 deletions
diff --git a/hyperterm/core/status.sh b/hyperterm/core/status.sh index d5f5dc5..c9b0b64 100644 --- a/hyperterm/core/status.sh +++ b/hyperterm/core/status.sh @@ -1,25 +1,14 @@ #!/bin/bash # System Status -function exitstatus(){ - local retval=$? +function exitstatus() { + local retval=$1 unset status - - # Import colors _colors_bash "$@" case $retval in - 0) - status="[${retval}]" - printf '%b%s' "${BOLD}${CYAN}" "${status}" - ;; - 1) - status="[${retval}]" - printf '%b%s' "${BOLD}${PURPLE}" "${status}" - ;; - *) - status="[${retval}]" - printf '%b%s' "${BOLD}${RED}" "${status}" - ;; + 0) status="[${retval}]"; printf '%b%s' "${BOLD}${CYAN}" "${status}" ;; + 1) status="[${retval}]"; printf '%b%s' "${BOLD}${PURPLE}" "${status}" ;; + *) status="[${retval}]"; printf '%b%s' "${BOLD}${RED}" "${status}" ;; esac } diff --git a/hyperterm/hyperterm.sha512 b/hyperterm/hyperterm.sha512 index 1424387..5733a0b 100644 --- a/hyperterm/hyperterm.sha512 +++ b/hyperterm/hyperterm.sha512 @@ -6,14 +6,14 @@ b760a908a3f6222b974abc1f7464bde0f5427f120f1e7ef1c6d97ae61769e552ef3b5cb88e193e95 f3e00b2aa8ab9f3ab44570adaa2520408ed66fd00f551654d60b64a4be3546ec781b7efa39bcd774937e654b6ffb4c7af3f21eeb36caf9c01f82f85cf28e2b4d ./core/languages.sh fdc570118a65a2b00571fd374be1aa983d41e9722bee6e604e2b00fcd2e1931df4dfd8951f15a2402dfcb3cbc76a5fe8d9d564a83fec73595dcaae2e38ac338a ./core/autodep.sh 7447d3e167ab207d3ef4218e201a06bf5a3fc23281639f16f7f405f1d66b73923845d450fdb0a94672757866a9da0324f728564a1b61b2ed1678fe576eb565cf ./core/autocomplete.sh -065cfa39f1b4312ed275ad1039827a24f703176c653a8d27303d145f9d389a60ec5b3a9eb167e060cc6fd093b9c03cfb1a8b70254d444fbc6e62e2297d88b310 ./core/status.sh -c6c149704883ce5cbbd941019259effb105dd6910c98910782024311b3362df2e68d03c947908d40686c2620c1521aeee2ffb019a906ad367be1cc3d429ecd82 ./themes/minterm.sh -0b6705dae598dff024fc10fd9c4710a298e7d2ab7b7f3895eb8654d1ad7236a0b0f72511f1db7df8155f32aa882ac2bf55a9d6a04c227ed6285b866ec3a29904 ./themes/simple.sh -1d70b22277aa1d37e770f952411687c30d47da8caae278e431208671af239591d259258b4982ca9b61faf57f266958a002180496b0db036a94250604212aa1bb ./themes/pure.sh -074e8549d638dee7470583c04ebbb7408181974806bd5e2cf5fc134ddee83c01040ed9d59a8aa00a87287b25df1c2e23edf3c063426952a8aeb56db8310ef8fd ./themes/joy.sh -403fe028575baa22c39dd11ac56a246369b8e38524c216f6d564b59aa22c60a426941f755ad3adb75f212c9124350ce3aeb114ba365ded1ed33b62ac480a60aa ./themes/light_theme.sh -7efe3770a629d6168b1c9007f420d2d657fa38fc1673dd5dc365dcf3c9d4c34456e346f9ed739c347133f93ad78cf88d0d54fe95523ce5d91a51cd49650d7525 ./themes/special.sh -07bb7b6bd609e855d0a7c9e39a0ff2959851f559106e8f59816312f298b03e87f39e53430869ed61a1271e265e976ea6b56f7ccee46c4ec3c37b40f1fc11cfad ./themes/default.sh +99f9e937e39495f60495bc89f055f29e1bee25911c9bea5c8b2a7c6a5bdc417502f17da8cb9e63ea957eea9337c6fe1c63c208a3ff3ed33ef2ca8c1dbe328599 ./core/status.sh +65f850342f43bdfe68b2b0339a051a795c6640b4bd4f7c6b6b979ca214607f9a87d9cfdc6955785c5ca087d09294781ee8cb3a62dc0160cd8a105ff65cc82465 ./themes/minterm.sh +c6467d21cc7fdf0c3da797be8521db96069361e5064ace5b1c3a509679e2adb6d57c5a865a158fa5dfec3dd94892fa47a3c1b7b985d7808af646118ffeceb771 ./themes/simple.sh +19bf23dd3ca5967125dbd9d7cbb02312a6d230320869d0ebbb2dbd6994921cb02a627180d5ccaafb0e8e16baf25abcb29f5ba94a0b25bd376b6a963dda1a8d7a ./themes/pure.sh +a845a8bbf6bad13bd3c6a40b27c65055a4f55c8f238e30e4bd9bc3ace16d15ae7ccdf51b38d9064f55d60fbd1e1166ae4918ab6ddd3a495b08366f2554dd94e6 ./themes/joy.sh +af819a140b2a66de3bd53ec0911b1253f661aa2c0a84c4fed4608880ec467340c8076805bea622c82b9dfdbc3a70fa6f81559d39d42e7cb053fb8a71a462f3e0 ./themes/light_theme.sh +e0805f47622d0e245333e933fcf767b88e8d2157e57f156f069b24dd13d220866908f7aabfb2592ca9b89dc3c490a4480bd7b19c76328d38f1a72db2f0fc19b6 ./themes/special.sh +7d64675844172bb30235649848147f5b15b7b7575af1e7b33ce24d71e11f1b17c063151f43bc4f858fe7f770c292b11e9a6fb21fdf91b7e180336b1918746841 ./themes/default.sh f760432c3d76befad30588299eb2d1412d77b22fd850ffbd840c72123885d4e916a7e0b16e7048c5dcd6e58fa3bc0807cda18ae64045a7495684ba37109e4b4a ./tools/compress.sh 1b9c148ab8577fe15b4d503ec480b36eeaea42bf7048e35a0866280ee87a6c8de31c54600a8e455147db987e7aa61c8aa585748a9945c0472992d28fdccb8c0f ./tools/export.sh 8606294d403c5fd9cd5c316401387b5aea79de1d193aa9f23210c94bf32ff83e8d9dc98466d017bc4d9d037cf548335fde1b2f2631e3597a87eec7ccb8e78d6c ./tools/network.sh 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\] }" |