dotfiles/.bashrc
2024-07-08 07:42:08 +03:30

112 lines
2.4 KiB
Bash

#
# ~/.bashrc
#
# [[ $- == *i* ]] && source /usr/share/blesh/ble.sh --noattach
source_if_exist() {
[[ -f "$1" ]] && source "$1"
}
source_if_exist ~/.bash_aliases
source_if_exist /usr/share/doc/pkgfile/command-not-found.bash
d=.dircolors
test -r $d && eval "$(dircolors $d)"
complete -c man which
# Manage history
export HISTFILESIZE=100000
export HISTSIZE=100000
export HISTTIMEFORMAT="[%F %T] "
export HISTCONTROL=erasedups
shopt -s autocd
[[ -f /usr/bin/zoxide ]] && eval "$(zoxide init bash)"
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
shopt -s checkwinsize
shopt -s no_empty_cmd_completion
shopt -s histappend
#PROMPT_COMMAND='history -a'
# Change the window title of X terminals
case ${TERM} in
[aEkx]term*|rxvt*|gnome*|konsole*|interix|tmux*)
PS1='\[\033]0;\u@\h:\w\007\]'
;;
screen*)
PS1='\[\033k\u@\h:\w\033\\\]'
;;
*)
unset PS1
;;
esac
use_color=false
if type -P dircolors >/dev/null ; then
LS_COLORS=
if [[ -f ~/.dir_colors ]] ; then
eval "$(dircolors -b ~/.dir_colors)"
elif [[ -f /etc/DIR_COLORS ]] ; then
eval "$(dircolors -b /etc/DIR_COLORS)"
else
eval "$(dircolors -b)"
fi
if [[ -n ${LS_COLORS:+set} ]] ; then
use_color=true
else
unset LS_COLORS
fi
else
case ${TERM} in
[aEkx]term*|rxvt*|gnome*|konsole*|screen|tmux|cons25|*color) use_color=true;;
esac
fi
if ${use_color} ; then
if [[ ${EUID} == 0 ]] ; then
PS1+='\[\033[01;31m\]\h\[\033[01;34m\] \w \$\[\033[00m\] '
else
PS1+='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
#BSD#@export CLICOLOR=1
#GNU#@alias ls='ls --color=auto'
alias grep='grep --colour=auto'
else
# show root@ when we don't have colors
PS1+='\u@\h \w \$ '
fi
for sh in /etc/bash/bashrc.d/* ; do
[[ -r ${sh} ]] && source "${sh}"
done
# Try to keep environment pollution down, EPA loves us.
unset use_color sh
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/miniconda3/etc/profile.d/conda.sh" ]; then
. "/opt/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/opt/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
___MY_VMOPTIONS_SHELL_FILE="${HOME}/.jetbrains.vmoptions.sh"; if [ -f "${___MY_VMOPTIONS_SHELL_FILE}" ]; then . "${___MY_VMOPTIONS_SHELL_FILE}"; fi