rwx/shell
This commit is contained in:
parent
b67107c737
commit
527b2d2a67
3 changed files with 8 additions and 5 deletions
|
@ -17,7 +17,7 @@ x() {
|
||||||
"${@}"
|
"${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
[ "${RWX_SHELL}" = "bash" ] || return
|
[ "$(rwx_shell)" = "bash" ] || return
|
||||||
|
|
||||||
# shellcheck disable=SC3033
|
# shellcheck disable=SC3033
|
||||||
..() {
|
..() {
|
||||||
|
|
|
@ -11,7 +11,6 @@ RWX_SELF_NAME="rwx"
|
||||||
# │ variables │
|
# │ variables │
|
||||||
# ╰───────────╯
|
# ╰───────────╯
|
||||||
|
|
||||||
RWX_SHELL="$(cat "/proc/${$}/comm")"
|
|
||||||
RWX_SYSTEM_ROOT="/usr/local/lib"
|
RWX_SYSTEM_ROOT="/usr/local/lib"
|
||||||
|
|
||||||
RWX_MAIN_PATH="${RWX_ROOT_SYSTEM}/${RWX_MAIN_NAME}"
|
RWX_MAIN_PATH="${RWX_ROOT_SYSTEM}/${RWX_MAIN_NAME}"
|
||||||
|
@ -21,6 +20,10 @@ rwx_self_user() {
|
||||||
echo "${HOME}/${RWX_SELF_NAME}"
|
echo "${HOME}/${RWX_SELF_NAME}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rwx_shell() {
|
||||||
|
cat "/proc/${$}/comm"
|
||||||
|
}
|
||||||
|
|
||||||
# ╭──────╮
|
# ╭──────╮
|
||||||
# │ core │
|
# │ core │
|
||||||
# ╰──────╯
|
# ╰──────╯
|
||||||
|
@ -119,7 +122,7 @@ rwx_source() {
|
||||||
|
|
||||||
# run initial steps
|
# run initial steps
|
||||||
rwx_main() {
|
rwx_main() {
|
||||||
case "${RWX_SHELL}" in
|
case "$(rwx_shell)" in
|
||||||
"sh" | \
|
"sh" | \
|
||||||
"bash")
|
"bash")
|
||||||
# system root
|
# system root
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
_rwx_shell_color() {
|
_rwx_shell_color() {
|
||||||
local code="${1}"
|
local code="${1}"
|
||||||
case "${RWX_SHELL}" in
|
case "$(rwx_shell)" in
|
||||||
"bash")
|
"bash")
|
||||||
printf "\x01\e[0"
|
printf "\x01\e[0"
|
||||||
if [ -n "${code}" ]; then
|
if [ -n "${code}" ]; then
|
||||||
|
@ -33,7 +33,7 @@ rwx_shell_configure() {
|
||||||
PS1="\$(rwx_shell_prompt \${?})"
|
PS1="\$(rwx_shell_prompt \${?})"
|
||||||
PS2="├ "
|
PS2="├ "
|
||||||
# specific
|
# specific
|
||||||
case "${RWX_SHELL}" in
|
case "$(rwx_shell)" in
|
||||||
"bash")
|
"bash")
|
||||||
# completion
|
# completion
|
||||||
local root="/usr/share/bash-completion"
|
local root="/usr/share/bash-completion"
|
||||||
|
|
Loading…
Add table
Reference in a new issue