This commit is contained in:
Gal Szkolnik 2022-09-29 18:32:34 -04:00
commit b21b7e0d5f
4 changed files with 15 additions and 4 deletions

View File

@ -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]++' | \

View File

@ -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

View File

@ -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'")

View File

@ -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'