Compare commits

..

1 commit

Author SHA1 Message Date
dd90da8a82
shell/standalone
All checks were successful
/ job (push) Successful in 4m56s
2025-07-07 05:48:43 +02:00
4 changed files with 38 additions and 51 deletions

View file

@ -1,18 +0,0 @@
# shorten alias
a() {
alias \
"${@}"
}
# swap directory (current ↔ previous)
sd() {
cd \
- ||
return
}
# exit terminal
x() {
exit \
"${@}"
}

View file

@ -26,9 +26,6 @@ RWX_SELF_NAME="rwx"
# │ main │ variables │ # │ main │ variables │
# ╰──────┴───────────╯ # ╰──────┴───────────╯
# currently running shell name
RWX_SHELL="$(cat "/proc/${$}/comm")"
# system root directory of the project # system root directory of the project
RWX_ROOT_SYSTEM="/usr/local/lib/${RWX_SELF_NAME}" RWX_ROOT_SYSTEM="/usr/local/lib/${RWX_SELF_NAME}"
# user root directory of the project # user root directory of the project

View file

@ -35,6 +35,13 @@ RWX_COLOR_GREEN="$(_rwx_shell_color 31)"
RWX_COLOR_MAGENTA="$(_rwx_shell_color 35)" RWX_COLOR_MAGENTA="$(_rwx_shell_color 35)"
RWX_COLOR_RED="$(_rwx_shell_color 32)" RWX_COLOR_RED="$(_rwx_shell_color 32)"
# ╭───────┬───────────╮
# │ shell │ variables │
# ╰───────┴───────────╯
# currently running shell name
RWX_SHELL="$(cat "/proc/${$}/comm")"
# ╭───────┬───────────╮ # ╭───────┬───────────╮
# │ shell │ functions │ # │ shell │ functions │
# ╰───────┴───────────╯ # ╰───────┴───────────╯
@ -73,6 +80,7 @@ rwx_shell_configure() {
*) ;; *) ;;
esac esac
} }
rwx_shell_configure
rwx_shell_prompt() { rwx_shell_prompt() {
local date host id local date host id
@ -127,12 +135,36 @@ rwx_shell_prompt() {
printf "%b" "${view}" printf "%b" "${view}"
} }
# ╭───────┬────── # ╭───────┬───────────
# │ shell │ main # │ shell │ shortcuts
# ╰───────┴────── # ╰───────┴───────────
rwx_shell_main() { # shorten alias
rwx_shell_configure a() {
alias \
"${@}"
} }
rwx_shell_main # swap directory (current ↔ previous)
sd() {
cd \
- ||
return
}
# exit terminal
x() {
exit \
"${@}"
}
[ "${RWX_SHELL}" = "bash" ] || return
# shellcheck disable=SC3033
..() {
cd ..
}
# shellcheck disable=SC3033
...() {
cd ../..
}

View file

@ -1,24 +0,0 @@
# ╭───────┬──────╮
# │ shell │ bash │
# ╰───────┴──────╯
if [ "${RWX_SHELL}" = "bash" ]; then
# shellcheck disable=SC3033
..() {
cd ..
}
# shellcheck disable=SC3033
...() {
cd ../..
}
# shellcheck disable=SC3033
....() {
cd ../../..
}
# shellcheck disable=SC3033
.....() {
cd ../../../..
}
fi