dotfiles/files/.bashrc

90 lines
2.7 KiB
Bash
Raw Normal View History

2022-12-17 00:37:53 -05:00
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
2023-02-03 23:21:16 -05:00
# history settings
2023-02-01 01:12:30 -05:00
HISTSIZE=5000
HISTFILESIZE=10000
2023-02-03 23:21:16 -05:00
2023-02-01 01:12:30 -05:00
shopt -s histappend
2023-02-03 23:21:16 -05:00
2023-02-01 05:13:27 -05:00
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
2023-02-01 01:12:30 -05:00
2023-02-03 23:08:35 -05:00
export HISTCONTROL=erasedups
2022-12-17 00:37:53 -05:00
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
shopt -s globstar
2023-02-03 23:25:38 -05:00
# automatically prepend cd when entering just a path in the shell
shopt -s autocd
2022-12-17 00:37:53 -05:00
# set a fancy prompt (non-color, unless we know we "want" color)
2022-12-27 19:12:25 -05:00
export TERM=xterm-color
2022-12-17 00:37:53 -05:00
# Alias definitions.
2023-02-26 01:36:59 -05:00
[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
2022-12-17 00:37:53 -05:00
2023-06-14 22:49:50 -04:00
# home-manager variables
[[ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]] &&
source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
2023-03-26 01:38:35 -04:00
# set PATH so it includes certain bin folders if they exist
[[ -d ~/bin ]] && PATH+=":$HOME/bin"
[[ -d ~/.local/bin ]] && PATH+=":$HOME/.local/bin"
2023-04-03 11:42:12 -04:00
[[ -d ~/scripts/bin ]] && PATH+=":$HOME/scripts/bin"
2023-03-26 01:38:35 -04:00
[[ -d /usr/local/go/bin ]] && PATH+=":/usr/local/go/bin"
2023-05-27 13:17:27 -04:00
[[ -d ~/go/bin ]] && PATH+=":$HOME/go/bin"
2022-12-17 00:37:53 -05:00
2023-02-04 00:50:10 -05:00
# source misc user scripts
2023-02-07 00:27:15 -05:00
if [ -d ~/git/dotfiles/source ]; then
2023-02-04 01:38:41 -05:00
for f in ~/git/dotfiles/source/.*; do if [[ -f $f ]]; then source $f ; fi; done
2023-02-04 01:38:11 -05:00
fi
2022-12-28 15:38:02 -05:00
2023-02-03 23:21:16 -05:00
# set prompt colors and style
2023-03-26 01:32:49 -04:00
[[ -f ~/.PS1 ]] && . ~/.PS1 ||
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
2023-01-23 08:45:00 -05:00
2023-02-03 23:21:16 -05:00
# fetch uninstalled package names when attempting command (arch only)
2023-03-26 01:32:49 -04:00
PKG_COMP=/usr/share/doc/pkgfile/command-not-found.bash
2023-03-26 01:33:25 -04:00
[[ -f $PKG_COMP ]] && . $PKG_COMP
2023-02-07 00:27:15 -05:00
2023-03-26 01:38:35 -04:00
# source fzf scripts
2023-02-07 00:50:21 -05:00
if [ -d ~/.fzf ]; then
2023-02-07 00:42:00 -05:00
source ~/.fzf/completion.bash
source ~/.fzf/key-bindings.bash
2023-02-07 00:27:15 -05:00
fi
2023-02-07 22:59:10 -05:00
# source client specific scripts
if [ -d ~/.client ]; then
for f in ~/.client/.*; do if [[ -f $f ]]; then source $f ; fi; done
fi
2023-02-26 01:49:25 -05:00
# source: https://stackoverflow.com/a/44232192
PATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PATH}))')"
2023-03-11 12:01:01 -05:00
if [ "$XDG_SESSION_TYPE" == "wayland" ]; then
2023-03-11 12:57:58 -05:00
export MOZ_ENABLE_WAYLAND=1
2023-03-11 13:22:53 -05:00
export QT_QPA_PLATFORM=wayland-egl
2023-03-11 12:01:01 -05:00
fi
2023-05-04 01:48:25 -04:00
# pnpm
export PNPM_HOME="/home/matt/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
2023-05-05 01:44:26 -04:00
# pnpm end
2023-05-05 18:54:53 -04:00
2023-07-05 17:49:23 -04:00
if [ -x "$(command -v fzf)" ]; then
export FZF_DEFAULT_OPTS='--color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9 --color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9 --color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6 --color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4'
fi
2023-05-05 18:54:53 -04:00
[ -x "$(command -v pokemon-colorscripts)" ] &&
2023-05-06 01:49:13 -04:00
[ "$POKE" == "true" ] &&
2023-05-05 18:54:53 -04:00
pokemon-colorscripts -r 1-5