Compare commits

...

4 commits

Author SHA1 Message Date
aec3d1a0af
shell/main
All checks were successful
/ job (push) Successful in 5m27s
2025-07-07 21:55:01 +02:00
efe07205fa
shell/0 2025-07-07 21:50:34 +02:00
ff5116380c
bash/if 2025-07-07 21:43:48 +02:00
a06bab3e97
shell/bash 2025-07-07 21:38:07 +02:00
3 changed files with 47 additions and 12 deletions

View file

@ -16,14 +16,3 @@ x() {
exit \
"${@}"
}
[ "${RWX_SHELL}" = "bash" ] || return
# shellcheck disable=SC3033
..() {
cd ..
}
# shellcheck disable=SC3033
...() {
cd ../..
}

View file

@ -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

24
sh/shell/bash.sh Normal file
View file

@ -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