2017-02-07 16:16:45 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# bashrc is executed when a bash process starts
|
|
|
|
|
2017-02-20 18:31:28 -06:00
|
|
|
# these are all paths used across all the dotfiles and should be assumed to be
|
|
|
|
# loaded and properly set by every script - this means you are responsible for
|
|
|
|
# making sure they're loaded!
|
2017-02-07 16:16:45 -06:00
|
|
|
export XDG_CONFIG_HOME="$HOME/.config"
|
|
|
|
export DOTFILES_PATH="$XDG_CONFIG_HOME/dotfiles"
|
2018-10-23 14:37:57 -05:00
|
|
|
NICE_HOME="$HOME"
|
2018-01-15 18:35:37 -06:00
|
|
|
|
2018-10-23 14:37:57 -05:00
|
|
|
[[ $(basename "${HOME}") = "usr" ]] && NICE_HOME="$(realpath "$HOME/..")"
|
|
|
|
[[ $(basename "${HOME}") = ".home" ]] && NICE_HOME="$(realpath "$HOME/..")"
|
|
|
|
|
|
|
|
export NICE_HOME
|
2017-02-07 16:16:45 -06:00
|
|
|
|
2017-04-17 01:37:19 -05:00
|
|
|
# TODO: nice home on a per-device basis
|
|
|
|
|
2017-04-14 11:52:18 -05:00
|
|
|
# set our PATH
|
2017-02-20 18:31:28 -06:00
|
|
|
source "$DOTFILES_PATH/shell/paths"
|
|
|
|
|
2017-02-07 16:16:45 -06:00
|
|
|
# import our aliases
|
|
|
|
source "$DOTFILES_PATH/shell/aliases"
|
|
|
|
|
|
|
|
# import our global shell functions
|
2018-09-05 09:54:30 -05:00
|
|
|
source "$DOTFILES_PATH/shell/funcs"
|
2017-02-07 16:16:45 -06:00
|
|
|
|
|
|
|
# import our autocompletions
|
|
|
|
source "$DOTFILES_PATH/shell/autocompletions"
|
|
|
|
|
|
|
|
# load our key binds
|
|
|
|
bind -f "$DOTFILES_PATH/shell/inputrc"
|
|
|
|
|
2017-11-13 15:55:11 -06:00
|
|
|
# less tab size of 2 spaces
|
|
|
|
LESS="-x2"
|
|
|
|
|
2018-07-05 09:47:46 -05:00
|
|
|
# stop parsing on a non-interactive shell
|
|
|
|
[ -z "$PS1" ] && return
|
|
|
|
|
2018-08-21 10:02:55 -05:00
|
|
|
# load our vconsole colors
|
|
|
|
if [ "${TERM%%-*}" = 'linux' ]; then
|
|
|
|
BASE16_SHELL="$DOTFILES_PATH/scripts/colors/vconsole"
|
|
|
|
[[ -s "$BASE16_SHELL" ]] && source "$BASE16_SHELL"
|
|
|
|
fi
|
|
|
|
|
2018-07-05 09:47:46 -05:00
|
|
|
# load our terminal colors
|
|
|
|
BASE16_SHELL="$DOTFILES_PATH/scripts/colors/shell"
|
|
|
|
[[ -s "$BASE16_SHELL" ]] && source "$BASE16_SHELL"
|
|
|
|
|
|
|
|
# disable ctrl-s terminal freeze
|
|
|
|
[[ $- == *i* ]] && stty -ixon
|
|
|
|
|
|
|
|
# allow ** recursive wildcard globbing
|
|
|
|
shopt -s globstar
|
|
|
|
|
|
|
|
# import our prompt
|
|
|
|
source "$DOTFILES_PATH/shell/prompt"
|
|
|
|
|
2017-02-07 16:16:45 -06:00
|
|
|
# prevents binds or commands pulling from history from insta-sending, and
|
|
|
|
# instead places them in the readline for editing
|
|
|
|
shopt -s histverify
|
|
|
|
|
|
|
|
# prevents some Java GUI apps from not working or rendering properly due to
|
|
|
|
# using bspwm
|
|
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
|
|
|
|
|
|
# load a per-device config last so anything can be overridden
|
|
|
|
if [ -a "$HOME/.env_bashrc" ]; then
|
|
|
|
source "$HOME/.env_bashrc"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# we assume the user uses "$HOME" to just store their mess of dotfiles and other
|
|
|
|
# nonsense that clutters it up and that they have a preferred starting
|
|
|
|
# directory where they keep the stuff they actually care about
|
|
|
|
# we only do this if the user is opening a shell at $HOME
|
|
|
|
if [ "$PWD" = "$HOME" ]; then
|
|
|
|
cd "$NICE_HOME"
|
|
|
|
fi
|
2017-02-20 18:31:28 -06:00
|
|
|
|
2018-11-03 14:06:15 -05:00
|
|
|
_make_paths
|
|
|
|
|
2018-06-05 11:05:20 -05:00
|
|
|
LS_COLORS='ow=01;36;40'
|
|
|
|
export LS_COLORS
|
|
|
|
|
2017-02-20 18:31:28 -06:00
|
|
|
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
|