Cleanup behavior to function when things are missing

This commit is contained in:
Lockszmith 2022-05-29 00:08:37 +00:00
parent 999422da87
commit 12e3c5a470
14 changed files with 35 additions and 19 deletions

View File

@ -1,5 +1,4 @@
if [ -z $_byobu_sourced ]; then if [[ -z "$_byobu_sourced" && -x /usr/bin/byobu-launch ]]; then
_byobu_sourced=1 . /usr/bin/byobu-launch 2>/dev/null || true _byobu_sourced=1 . /usr/bin/byobu-launch 2>/dev/null || true
exit
fi fi

View File

@ -1,9 +1,9 @@
# set PATH so it includes user's private bin if it exists # set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then if [[ -d "$HOME/bin" ]] ; then
export PATH="~/bin:$PATH" export PATH="~/bin:$PATH"
fi fi
# set PATH so it includes user's private bin if it exists # set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then if [[ -d "$HOME/.local/bin" ]] ; then
export PATH="~/.local/bin:$PATH" export PATH="~/.local/bin:$PATH"
fi fi

View File

@ -1,7 +1,10 @@
alias sudo="/usr/bin/sudo " alias sudo="/usr/bin/sudo "
alias nvim="/usr/bin/nvim -p " PREFERED_VI=$(type -fP nvim vim | head -1)
alias vim="nvim " [[ -z "$PREFERED_VI" ]] && PREFERED_VI=$(type -fP vi | head -1) || alias vi_editor="$PREFERED_VI -p "
alias vi="nvim " [[ -z "$PREFERED_VI" ]] && alias vi_editor='eval $EDITOR ' || alias vi_editor="$PREFERED_VI "
alias nvim="vi_editor "
alias vim="vi_editor "
alias vi="vi_editor "
alias lessr="less --raw-control-chars " alias lessr="less --raw-control-chars "

View File

@ -0,0 +1,5 @@
if [[ -n "$(type -fP setxkbmap)" ]]; then
setxkbmap -option
setxkbmap -option caps:escape
setxkbmap -option caps:ctrl_modifier
fi

View File

@ -0,0 +1,5 @@
if [[ -n "$(type -fP chezmoi)" ]]; then
CHEZMOI_OUT="$(chezmoi status || true)x"
[[ -n "$CHEZMOI_OUT" ]] && printf "\nChezmoi changes:\n" && echo "${CHEZMOI_OUT%?}"
unset CHEZMOI_OUT
fi

View File

@ -1 +0,0 @@
chezmoi status || true

View File

@ -0,0 +1 @@
echo ""

View File

@ -1,3 +0,0 @@
setxkbmap -option
setxkbmap -option caps:escape
setxkbmap -option caps:ctrl_modifier

View File

@ -1 +1,6 @@
eval "$(oh-my-posh init bash --config ~/.poshtheme.omp.json)" if [[ -n "$(type -fP oh-my-posh)" ]]; then
OHMYPOSH_CONFIG=''
[[ -r ~/.poshtheme.omp.json ]] && OHMYPOSH_CONFIG="~/.poshtheme.omp.json"
eval "$(oh-my-posh init bash --config $OHMYPOSH_CONFIG)"
unset OHMYPOSH_CONFIG
fi

View File

@ -1 +1 @@
source <(chezmoi completion bash) [[ -n "$BASH_COMPLETION_EXIST" && -n $(type -fP chezmoi) ]] && source <(chezmoi completion bash)

View File

@ -1,4 +1,4 @@
# The next line updates PATH for the Google Cloud SDK. # The next line updates PATH for the Google Cloud SDK.
if [ -f '/usr/lib/google-cloud-sdk/path.bash.inc' ]; then source '/usr/lib/google-cloud-sdk/path.bash.inc'; fi [[ -f '/usr/lib/google-cloud-sdk/path.bash.inc' ]] && source '/usr/lib/google-cloud-sdk/path.bash.inc'
# The next line enables shell command completion for gcloud. # The next line enables shell command completion for gcloud (as long as gcloud is IN the path).
if [ -f '/usr/lib/google-cloud-sdk/completion.bash.inc' ]; then source '/usr/lib/google-cloud-sdk/completion.bash.inc'; fi [[ -n "$(type -fP gcloud)" && -f '/usr/lib/google-cloud-sdk/completion.bash.inc' ]] && source '/usr/lib/google-cloud-sdk/completion.bash.inc'

View File

@ -1,2 +1,2 @@
source <(pip completion --bash) [[ -n $(type -fP pip) ]] && source <(pip completion --bash)

View File

@ -1,3 +1,4 @@
if [ -r /usr/bin/terraform ]; then TERRAFORM_BIN=$(type -fP terraform | head -1)
complete -C /usr/bin/terraform terraform if [[ -n $TERRAFORM_BIN ]]; then
complete -C $TERRAFORM_BIN terraform
fi fi

View File

@ -0,0 +1 @@
[[ -x /usr/share/bash-completion/bash_completion ]] && BASH_COMPLETION_EXIST=1