diff --git a/sh/alias/shell.sh b/sh/alias/shell.sh index d6f5801..f216c92 100644 --- a/sh/alias/shell.sh +++ b/sh/alias/shell.sh @@ -16,14 +16,3 @@ x() { exit \ "${@}" } - -[ "${RWX_SHELL}" = "bash" ] || return - -# shellcheck disable=SC3033 -..() { - cd .. -} -# shellcheck disable=SC3033 -...() { - cd ../.. -} diff --git a/sh/shell.sh b/sh/shell/0.sh similarity index 79% rename from sh/shell.sh rename to sh/shell/0.sh index 7e56658..6a28c31 100644 --- a/sh/shell.sh +++ b/sh/shell/0.sh @@ -1,3 +1,7 @@ +# ╭───────╮ +# │ shell │ +# ╰───────╯ + _rwx_shell_color() { local code="${1}" case "${RWX_SHELL}" in @@ -19,6 +23,11 @@ _rwx_shell_color() { ;; esac } + +# ╭───────┬───────────╮ +# │ shell │ constants │ +# ╰───────┴───────────╯ + RWX_COLOR_BROWN="$(_rwx_shell_color 33)" RWX_COLOR_CYAN="$(_rwx_shell_color 36)" RWX_COLOR_DEFAULT="$(_rwx_shell_color)" @@ -26,6 +35,10 @@ RWX_COLOR_GREEN="$(_rwx_shell_color 31)" RWX_COLOR_MAGENTA="$(_rwx_shell_color 35)" RWX_COLOR_RED="$(_rwx_shell_color 32)" +# ╭───────┬───────────╮ +# │ shell │ functions │ +# ╰───────┴───────────╯ + rwx_shell_configure() { [ -n "${ENV}" ] || ENV="${RWX_MAIN_PATH}" export ENV @@ -60,7 +73,6 @@ rwx_shell_configure() { *) ;; esac } -rwx_shell_configure rwx_shell_prompt() { local date host id @@ -114,3 +126,13 @@ rwx_shell_prompt() { # print printf "%b" "${view}" } + +# ╭───────┬──────╮ +# │ shell │ main │ +# ╰───────┴──────╯ + +rwx_shell_main() { + rwx_shell_configure +} + +rwx_shell_main diff --git a/sh/shell/bash.sh b/sh/shell/bash.sh new file mode 100644 index 0000000..400f83c --- /dev/null +++ b/sh/shell/bash.sh @@ -0,0 +1,24 @@ +# ╭───────┬──────╮ +# │ shell │ bash │ +# ╰───────┴──────╯ + +if [ "${RWX_SHELL}" = "bash" ]; then + +# shellcheck disable=SC3033 +..() { + cd .. +} +# shellcheck disable=SC3033 +...() { + cd ../.. +} +# shellcheck disable=SC3033 +....() { + cd ../../.. +} +# shellcheck disable=SC3033 +.....() { + cd ../../../.. +} + +fi