diff --git a/_home/dot_sz.shrc.d/10_path.env b/_home/dot_sz.shrc.d/10_path.env index 6f95470..3adc226 100644 --- a/_home/dot_sz.shrc.d/10_path.env +++ b/_home/dot_sz.shrc.d/10_path.env @@ -1,3 +1,13 @@ +append_to_envvar() { + local __VAL_tmp_=$(eval "echo '$1'") + local __VAL_tmp_=$(echo "$__VAL_tmp_" | sed "s/${2}//" ) + $1=$__VAL_tmp_${2} +} +insert_to_envvar() { + local __VAL_tmp_=$(eval "echo '$1'") + local __VAL_tmp_=$(echo "$__VAL_tmp_" | sed "s/${2}//" ) + $1=${2}$__VAL_tmp_ +} get_clean_path() { sed 's/ *:\?$//g;s/`/``/g;s/:/`:`/g;s/\\`:`/\\:/g;' <<< $1 | \ awk -v RS='`:`' -v ORS='`:`' '!arr[$0]++' | \ diff --git a/_home/dot_sz.shrc.d/22_editor.aliases b/_home/dot_sz.shrc.d/22_editor.aliases index 0e356dd..ddf0f14 100644 --- a/_home/dot_sz.shrc.d/22_editor.aliases +++ b/_home/dot_sz.shrc.d/22_editor.aliases @@ -1,6 +1,6 @@ MY_VI="$(type -fP my_vi)" -port DOOMROOT="$HOME/.config/_my.emacs/doom" +export DOOMROOT="$HOME/.config/_my.emacs/doom" [[ -x $DOOMROOT/emacs.d/bin/doom ]] && function doom() { export EMACSDIR="$DOOMROOT/emacs.d" export DOOMDIR="$DOOMROOT/config" diff --git a/_home/dot_sz.shrc.d/bash.post/10_oh-my-posh.hook b/_home/dot_sz.shrc.d/bash.post/10_oh-my-posh.hook index a598361..cb1d1d6 100644 --- a/_home/dot_sz.shrc.d/bash.post/10_oh-my-posh.hook +++ b/_home/dot_sz.shrc.d/bash.post/10_oh-my-posh.hook @@ -1,6 +1,6 @@ if [[ -n "$(which-command oh-my-posh)" ]]; then OHMYPOSH_CONFIG='' - [[ -r ~/.poshtheme.omp.json ]] && OHMYPOSH_CONFIG="~/.poshtheme.omp.json" - eval "$(oh-my-posh init bash --config $OHMYPOSH_CONFIG)" + [[ -r ~/.poshtheme.omp.json ]] && OHMYPOSH_CONFIG="--config ~/.poshtheme.omp.json" + eval "$(oh-my-posh init bash $OHMYPOSH_CONFIG)" unset OHMYPOSH_CONFIG fi diff --git a/_home/dot_sz.shrc.d/bash.pre/21_aliases b/_home/dot_sz.shrc.d/bash.pre/21_aliases index f4bb23a..0fda67a 100644 --- a/_home/dot_sz.shrc.d/bash.pre/21_aliases +++ b/_home/dot_sz.shrc.d/bash.pre/21_aliases @@ -1,4 +1,7 @@ alias which-command="type -fP " +function which-command() { + type -fP "${@}" +} function add-alias-to-bash-completion-code() { local CMD=$(printf "%s" "sed '" 's/\(complete\W.*-F\W.*' "$1" '.*$\)/\1 ' "$2/g'") diff --git a/_home/private_dot_local/bin/executable_sz-doctor b/_home/private_dot_local/bin/executable_sz-doctor index 26bb9fa..bb9d7c8 100644 --- a/_home/private_dot_local/bin/executable_sz-doctor +++ b/_home/private_dot_local/bin/executable_sz-doctor @@ -117,8 +117,6 @@ check-exist 'oh-my-posh' check-exist '~/.poshtheme.omp.json' "${USER_HOME}/.poshtheme.omp.json" "-r" check-exist 'tmux' || MISSING_APT_PACKAGES+=('tmux') check-exist 'git' || MISSING_APT_PACKAGES+=('git') -check-exist 'emacs' || MISSING_APT_PACKAGES+=('emacs') -check-exist 'monit' || MISSING_APT_PACKAGES+=('monit') check-exist 'direnv' || MISSING_APT_PACKAGES+=('direnv') check-exist "chezmoi" '' '' '' 'wget -O- chezmoi.io/get | bash # or' # wget -O- lksz.me/dotfiles | bash'