install.fairie/dotfiles/.bashrc

81 lines
2.1 KiB
Bash
Raw Normal View History

2022-10-27 20:14:14 -07:00
# shellcheck disable=SC1090,SC1091
# Prefer US English
export LANG="en_US"
# Detect support for advanced terminal features
2022-10-25 21:04:19 -07:00
if [ "$0" = 'bash' ] || [ "$0" = '/bin/bash' ]; then
export BASH_SUPPORT=true
fi
### Fig / LC_ALL
if [ "$BASH_SUPPORT" = 'true' ]; then
2022-10-28 14:43:32 -07:00
if [[ "$(hostname)" != *'-minimal' ]]; then
export LC_ALL="en_US.UTF-8"
fi
2022-10-25 21:04:19 -07:00
if [ -f "$HOME/.fig/shell/bashrc.pre.bash" ]; then
. "$HOME/.fig/shell/bashrc.pre.bash"
fi
fi
Update dotfiles/.bashrc, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/id_rsa.pub, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.github.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/brew/Brewfile.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse-minimal.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/mimeapps.list, dotfiles/.local/share/chezmoi/private_dot_config/chromium-flags.conf, dotfiles/.local/share/chezmoi/private_dot_config/pgcli/config, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions.json, dotfiles/.vscode/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-dark-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-light-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/README.md, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/icon.svg, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/package.json Deleted dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json
2022-11-22 02:33:57 -08:00
### Import Common Settings
if [ -f "$HOME/.config/shell/profile" ]; then
. "$HOME/.config/shell/profile"
fi
### Settings
Update dotfiles/.bashrc, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/id_rsa.pub, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.github.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/brew/Brewfile.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse-minimal.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/mimeapps.list, dotfiles/.local/share/chezmoi/private_dot_config/chromium-flags.conf, dotfiles/.local/share/chezmoi/private_dot_config/pgcli/config, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions.json, dotfiles/.vscode/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-dark-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-light-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/README.md, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/icon.svg, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/package.json Deleted dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json
2022-11-22 02:33:57 -08:00
if command -v shopt > /dev/null; then
2022-09-30 06:52:29 -07:00
shopt -s globstar
shopt -s histappend
shopt -s checkwinsize
fi
### History
export HISTFILE="$XDG_STATE_HOME/bash/history"
2022-09-30 06:58:48 -07:00
# Prompt (on bash only)
if [ "$BASH_SUPPORT" = 'true' ]; then
2022-10-31 05:51:14 -07:00
if [[ "$(hostname)" != *'-minimal' ]]; then
### Styled Terminal
case "$TERM" in
xterm* | rxvt* | Eterm | aterm | kterm | gnome* | alacritty)
PS1="\n \[\033[0;34m\]╭─\[\033[0;31m\]\[\033[0;37m\]\[\033[41m\] $OS_ICON \u \[\033[0m\]\[\033[0;31m\]\[\033[44m\]\[\033[0;34m\]\[\033[44m\]\[\033[0;30m\]\[\033[44m\] \w \[\033[0m\]\[\033[0;34m\] \n \[\033[0;34m\]╰ \[\033[1;36m\]\$ \[\033[0m\]"
;;
esac
2022-10-31 05:51:14 -07:00
### Directory Colors (https://github.com/trapd00r/LS_COLORS)
command -v gdircolors > /dev/null 2>&1 || gdircolors() { dircolors "$@"; }
Update dotfiles/.bashrc, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/id_rsa.pub, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.github.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/brew/Brewfile.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse-minimal.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/mimeapps.list, dotfiles/.local/share/chezmoi/private_dot_config/chromium-flags.conf, dotfiles/.local/share/chezmoi/private_dot_config/pgcli/config, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions.json, dotfiles/.vscode/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-dark-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-light-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/README.md, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/icon.svg, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/package.json Deleted dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json
2022-11-22 02:33:57 -08:00
if command -v gdircolors > /dev/null && [ -f "$XDG_CONFIG_HOME/dircolors" ]; then
eval "$(gdircolors -b "$XDG_CONFIG_HOME/dircolors")"
fi
fi
2022-09-26 19:46:23 -07:00
fi
Update dotfiles/.bashrc, dotfiles/.local/share/chezmoi/dot_bashrc.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/private_id_rsa.tmpl, dotfiles/.local/share/chezmoi/dot_ssh/id_rsa.pub, dotfiles/.local/share/chezmoi/dot_ssh/authorized_keys.github.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/brew/Brewfile.tmpl, dotfiles/.local/share/chezmoi/.chezmoidata.yaml, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/oh-my-posh/Betelgeuse-minimal.omp.json, dotfiles/.local/share/chezmoi/private_dot_config/powershell/user_profile.ps1, dotfiles/.local/share/chezmoi/dot_profile.tmpl, dotfiles/.local/share/chezmoi/private_dot_config/mimeapps.list, dotfiles/.local/share/chezmoi/private_dot_config/chromium-flags.conf, dotfiles/.local/share/chezmoi/private_dot_config/pgcli/config, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions.json, dotfiles/.vscode/settings.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-dark-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/themes/themer-light-color-theme.json, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/README.md, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/icon.svg, dotfiles/.local/share/chezmoi/private_dot_config/private_Code/User/extensions/theme-betelgeuse-vscode/package.json Deleted dotfiles/.local/share/chezmoi/private_dot_config/powershell/takuya.omp.json
2022-11-22 02:33:57 -08:00
### Bash Initialization Hooks
if [ "$BASH_SUPPORT" = 'true' ]; then
### direnv
if command -v direnv > /dev/null; then
eval "$(direnv hook bash)"
fi
### Java (asdf)
if [ -f "$HOME/.local/asdf/plugins/java/set-java-home.bash" ]; then
. "$HOME/.local/asdf/plugins/java/set-java-home.bash"
fi
2022-10-25 21:04:19 -07:00
### zoxide
if command -v zoxide > /dev/null; then
2022-11-02 10:10:02 -07:00
eval "$(zoxide init --cmd cd bash)"
fi
2022-10-25 21:04:19 -07:00
### Fig
if [ -f "$HOME/.fig/shell/bashrc.post.bash" ]; then
. "$HOME/.fig/shell/bashrc.post.bash"
fi
### Vault
if command -v vault > /dev/null; then
complete -C vault vault
fi
fi