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
4 changed files with 51 additions and 38 deletions

18
sh/alias/shell.sh Normal file
View file

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

View file

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

View file

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