2016-09-21 01:22:14 +02: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
|
|
|
|
|
2016-10-14 15:00:13 +02:00
|
|
|
# Make sure we get system-wide first
|
|
|
|
if [ -r /etc/bash.bashrc ]; then
|
|
|
|
source /etc/bash.bashrc
|
|
|
|
fi
|
|
|
|
|
2016-09-21 01:22:14 +02:00
|
|
|
# If not running interactively, don't do anything
|
|
|
|
[ -z "$PS1" ] && return
|
|
|
|
|
2016-10-14 15:00:13 +02:00
|
|
|
# Make sure we do have profile sourced, otherwise source it
|
2016-09-26 18:11:51 +02:00
|
|
|
[ -z "$DOTFILES" ] && source ~/.profile
|
|
|
|
##
|
|
|
|
[ -z "$DOTFILES" ] && echo ".profile missing" && exit 1
|
|
|
|
|
|
|
|
|
|
|
|
DOTBASH="$DOTFILES/bash"
|
2016-09-26 15:40:04 +02:00
|
|
|
|
2016-09-21 01:22:14 +02:00
|
|
|
# make less more friendly for non-text input files, see lesspipe(1)
|
|
|
|
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
|
|
|
|
|
|
|
|
|
|
|
# enable programmable completion features (you don't need to enable
|
|
|
|
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
|
|
|
# sources /etc/bash.bashrc).
|
|
|
|
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
|
2016-10-14 15:00:13 +02:00
|
|
|
source /etc/bash_completion
|
2016-09-21 01:22:14 +02:00
|
|
|
fi
|
|
|
|
|
2016-09-26 15:40:04 +02:00
|
|
|
# Load main things
|
2016-10-05 02:05:06 +02:00
|
|
|
if [ -d "$DOTBASH/bash.d" ]; then
|
2020-04-15 21:50:04 +02:00
|
|
|
for f in colours aliases history prompt_command password-store
|
2016-10-02 23:49:56 +02:00
|
|
|
do
|
2016-10-14 15:00:13 +02:00
|
|
|
if [ -r "$DOTBASH/bash.d/$f" ]; then
|
|
|
|
source "$DOTBASH/bash.d/$f"
|
|
|
|
fi
|
2016-09-21 01:22:14 +02:00
|
|
|
done
|
|
|
|
fi
|
2016-09-26 15:40:04 +02:00
|
|
|
|
|
|
|
# Try hostname bashrcs
|
|
|
|
if [ -r "$DOTBASH/$HOSTNAME.bashrc" ]; then
|
|
|
|
source "$DOTBASH/$HOSTNAME.bashrc"
|
|
|
|
fi
|
|
|
|
|
2016-10-02 23:39:11 +02:00
|
|
|
if [ -r "$HOME/.bashrc.local" ]; then
|
|
|
|
source "$HOME/.bashrc.local"
|
|
|
|
fi
|