setup-cockpit/dotfiles/bash/bashrc

91 lines
2.5 KiB
Bash

# Personal BASHRC
# Source the originaly generated bashrc
. ~/SetupCockpit/dotfiles/bash/original_bashrc
# On Arch Linux, source pkgfile "command not found" hook
if [ -e /usr/share/doc/pkgfile/command-not-found.bash ]; then
source /usr/share/doc/pkgfile/command-not-found.bash
fi
# Enable colored less output
export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m'
# enable exit status in prompt command
PROMPT_COMMAND=__prompt_command
__prompt_command() {
local EXIT="$?"
PS1=""
local RCol='\[\e[0m\]'
local Red='\[\e[0;31m\]'
local Gre='\[\e[0;32m\]'
local BYel='\[\e[1;33m\]'
local BBlu='\[\e[1;34m\]'
local Pur='\[\e[0;35m\]'
if [ $EXIT != 0 ]; then
PS1+="${Red}\u${RCol}"
else
PS1+="${Gre}\u${RCol}"
fi
PS1+="${RCol}@${BBlu}\h${RCol}:${Pur}\w${RCol}$ ${RCol}"
}
# Enable bash-git-prompt
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
GIT_PROMPT_ONLY_IN_REPO=1
# uncomment to avoid fetching remote status
# GIT_PROMPT_FETCH_REMOTE_STATUS=0
# uncomment to avoid searching for changed files in submodules
# GIT_PROMT_IGNORE_SUBMODULES=1
# uncomment to avoid setting virtual environment info for node/python/conda environments
# GIT_PROMT_WITH_VIRTUAL_ENV=0
# uncomment to show upstream tracking branch
# GIT_PROMPT_SHOW_UPSTREAM=1
# can be no, normal or all; determines counting of untracked files
# GIT_PROMPT_SHOW_UNTRACKED_FILES=normal
# uncomment to avoid printing the number of changed files
# GIT_PROMPT_SHOW_CHANGED_FILES_COUNT=0
# uncomment to support Git older than 1.7.10
# GIT_PROMPT_STATUS_COMMAND=gitstatus_pre-1.7.10.sh
# uncomment for custom prompt start sequence
# GIT_PROMPT_START=...
# uncomment for custom prompt end sequence
# GIT_PROMPT_END=...
# as last entry source the gitprompt script
# use custom theme specified in file GIT_PROMPT_THEME_FILE (default ~/.git-prompt-colors.sh)
# GIT_PROMPT_THEME=Custom
# GIT_PROMPT_THEME_FILE=~/.git-prompt-colors.sh
# use theme optimized for solarized color scheme
GIT_PROMPT_THEME=Plague_Doctor
source ~/.bash-git-prompt/gitprompt.sh
fi
eval "$(register-python-argcomplete schedule_timer)"
case "$TERM" in
xterm-kitty) source <(kitty + complete setup bash);;
esac
stty -ixon # Disable Ctrl-S and Ctrl-Q