Compare commits
4 commits
dd90da8a82
...
aec3d1a0af
Author | SHA1 | Date | |
---|---|---|---|
aec3d1a0af | |||
efe07205fa | |||
ff5116380c | |||
a06bab3e97 |
3 changed files with 47 additions and 12 deletions
|
@ -16,14 +16,3 @@ x() {
|
||||||
exit \
|
exit \
|
||||||
"${@}"
|
"${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
[ "${RWX_SHELL}" = "bash" ] || return
|
|
||||||
|
|
||||||
# shellcheck disable=SC3033
|
|
||||||
..() {
|
|
||||||
cd ..
|
|
||||||
}
|
|
||||||
# shellcheck disable=SC3033
|
|
||||||
...() {
|
|
||||||
cd ../..
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
# ╭───────╮
|
||||||
|
# │ shell │
|
||||||
|
# ╰───────╯
|
||||||
|
|
||||||
_rwx_shell_color() {
|
_rwx_shell_color() {
|
||||||
local code="${1}"
|
local code="${1}"
|
||||||
case "${RWX_SHELL}" in
|
case "${RWX_SHELL}" in
|
||||||
|
@ -19,6 +23,11 @@ _rwx_shell_color() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ╭───────┬───────────╮
|
||||||
|
# │ shell │ constants │
|
||||||
|
# ╰───────┴───────────╯
|
||||||
|
|
||||||
RWX_COLOR_BROWN="$(_rwx_shell_color 33)"
|
RWX_COLOR_BROWN="$(_rwx_shell_color 33)"
|
||||||
RWX_COLOR_CYAN="$(_rwx_shell_color 36)"
|
RWX_COLOR_CYAN="$(_rwx_shell_color 36)"
|
||||||
RWX_COLOR_DEFAULT="$(_rwx_shell_color)"
|
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_MAGENTA="$(_rwx_shell_color 35)"
|
||||||
RWX_COLOR_RED="$(_rwx_shell_color 32)"
|
RWX_COLOR_RED="$(_rwx_shell_color 32)"
|
||||||
|
|
||||||
|
# ╭───────┬───────────╮
|
||||||
|
# │ shell │ functions │
|
||||||
|
# ╰───────┴───────────╯
|
||||||
|
|
||||||
rwx_shell_configure() {
|
rwx_shell_configure() {
|
||||||
[ -n "${ENV}" ] || ENV="${RWX_MAIN_PATH}"
|
[ -n "${ENV}" ] || ENV="${RWX_MAIN_PATH}"
|
||||||
export ENV
|
export ENV
|
||||||
|
@ -60,7 +73,6 @@ rwx_shell_configure() {
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
rwx_shell_configure
|
|
||||||
|
|
||||||
rwx_shell_prompt() {
|
rwx_shell_prompt() {
|
||||||
local date host id
|
local date host id
|
||||||
|
@ -114,3 +126,13 @@ rwx_shell_prompt() {
|
||||||
# print
|
# print
|
||||||
printf "%b" "${view}"
|
printf "%b" "${view}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ╭───────┬──────╮
|
||||||
|
# │ shell │ main │
|
||||||
|
# ╰───────┴──────╯
|
||||||
|
|
||||||
|
rwx_shell_main() {
|
||||||
|
rwx_shell_configure
|
||||||
|
}
|
||||||
|
|
||||||
|
rwx_shell_main
|
24
sh/shell/bash.sh
Normal file
24
sh/shell/bash.sh
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue