This commit is contained in:
Marc Beninca 2024-11-25 17:32:44 +01:00
parent 25e7cc4f6c
commit df1fb4f343
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 14 additions and 6 deletions

View file

@ -1,13 +1,18 @@
# constants
SH_MAIN_NAME="main.sh" SH_MAIN_NAME="main.sh"
SH_NAME="sh" SH_NAME="sh"
SH_SHELL="$(cat /proc/${$}/comm)"
SH_ROOT="/etc/${SH_NAME}" SH_ROOT="/etc/${SH_NAME}"
SH_USER="${HOME}/${SH_NAME}"
SH_MAIN="${SH_ROOT}/${SH_MAIN_NAME}" SH_MAIN="${SH_ROOT}/${SH_MAIN_NAME}"
[ -n "${ENV}" ] || export ENV="${SH_MAIN}" # variables
SH_SHELL="$(cat /proc/${$}/comm)"
SH_USER="${HOME}/${SH_NAME}"
# functions
_sh_ifs_new() { _sh_ifs_new() {
SH_IFS="${IFS}" SH_IFS="${IFS}"

View file

@ -27,6 +27,12 @@ SH_COLOR_MAGENTA="$(_sh_shell_color 35)"
SH_COLOR_RED="$(_sh_shell_color 32)" SH_COLOR_RED="$(_sh_shell_color 32)"
sh_shell_configure() { sh_shell_configure() {
[ -n "${ENV}" ] || ENV="${SH_MAIN}"
export ENV
# prompt
PS1="\$(sh_shell_prompt \${?})"
PS2="├ "
# specific
case "${SH_SHELL}" in case "${SH_SHELL}" in
"bash") "bash")
# completion # completion
@ -53,9 +59,6 @@ sh_shell_configure() {
;; ;;
*) ;; *) ;;
esac esac
# prompt
PS1="\$(sh_shell_prompt \${?})"
PS2="├ "
} }
sh_shell_configure sh_shell_configure