X-Git-Url: https://code.delx.au/dotfiles/blobdiff_plain/df9a6ce138275cd8cd7ce9b09a0c6c6cecfad4af..c1872248d369fdfb61c323a676c1706735b3d980:/.bashrc diff --git a/.bashrc b/.bashrc index 443153f..e8502b2 100644 --- a/.bashrc +++ b/.bashrc @@ -1,4 +1,4 @@ -# shellcheck disable=SC1090 # -- Can't follow non-constant source +# shellcheck disable=SC1090 disable=SC1091 # -- Can't follow non-constant source ########################### # Settings for all shells # @@ -17,9 +17,8 @@ while read -r p; do done < <(find -L ~/bin -maxdepth 1 -type d 2> /dev/null) # Set EMAIL from the freedesktop environment.d -if [ -r ~/.config/environment.d/10-email.conf ]; then - source ~/.config/environment.d/10-email.conf - export EMAIL +if ls ~/.config/environment.d/*.conf &> /dev/null; then + eval "$(awk -F= '{print $0 ";export " $1}' ~/.config/environment.d/*.conf)" fi # Pick up SSH agent socket @@ -62,6 +61,7 @@ export HISTCONTROL='erasedups:ignoredups:ignorespace' export HISTSIZE='100000' export HISTTIMEFORMAT='%F %T ' +[ -r /etc/bash_completion ] && source /etc/bash_completion ################## # Terminal setup # @@ -71,8 +71,10 @@ export HISTTIMEFORMAT='%F %T ' stty -ixon # hostname:workingdir -PROMPT_COMMAND='echo -ne "\\033]0;$(hostname| cut -d. -f1):${PWD/$HOME/~}\\007"' +PROMPT_COMMAND='echo -ne "\\033]0;$(hostname|cut -d. -f1):${PWD/$HOME/\~}\\007"' +# Use dark background colors in apps like vim +export COLORFGBG='15;0' ############# # Fancy PS1 # @@ -91,6 +93,7 @@ function find_up_exists { return 1 } +[ -r /usr/lib/git-core/git-sh-prompt ] && source /usr/lib/git-core/git-sh-prompt [ -r /usr/share/git/completion/git-prompt.sh ] && source /usr/share/git/completion/git-prompt.sh function my_git_ps1 { find_up_exists .git || return @@ -172,8 +175,7 @@ fi ########################## # GNU ls colours -# shellcheck disable=SC2046 -eval $(TERM=xterm dircolors 2> /dev/null) +eval "$(TERM=xterm dircolors 2> /dev/null)" # BSD ls colours export LSCOLORS="ExFxCxDxBxEGEDABAGACAD" @@ -222,7 +224,7 @@ alias bc='bc -ql' alias watch='watch -n1' alias sudo='sudo ' # ability to use aliases with sudo alias sudosu='sudo su -l -s /bin/bash' -alias py='PYTHONSTARTUP=~/.pythonrc.py python' +alias python='PYTHONSTARTUP=~/.pythonrc.py python3' alias webshare='python3 -mhttp.server' if ! command -v pbcopy &> /dev/null; then @@ -241,7 +243,8 @@ function man { LESS_TERMCAP_me=$'\E[0m' \ LESS_TERMCAP_us=$'\E[04;38;5;146m' \ LESS_TERMCAP_ue=$'\E[0m' \ - man --encoding ascii "$@" + LC_CTYPE=C \ + man "$@" } # Creates the directory if it doesn't exist, and changes into it @@ -273,3 +276,5 @@ function ssh_unsafe { ########### # The end # ########### + +[ -r ~/.bashrc_local ] && source ~/.bashrc_local