dotfiles/files/.bashrc
2023-03-11 13:22:53 -05:00

69 lines
1.9 KiB
Bash

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# history settings
HISTSIZE=5000
HISTFILESIZE=10000
shopt -s histappend
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
export HISTCONTROL=erasedups
# 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
# automatically prepend cd when entering just a path in the shell
shopt -s autocd
# set a fancy prompt (non-color, unless we know we "want" color)
export TERM=xterm-color
# Alias definitions.
[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
# set PATH so it includes user's private bin if it exists
[[ -d "$HOME/bin" ]] && PATH+=":$HOME/bin"
[[ -d "$HOME/.local/bin" ]] && PATH+=":$HOME/.local/bin"
# source misc user scripts
if [ -d ~/git/dotfiles/source ]; then
for f in ~/git/dotfiles/source/.*; do if [[ -f $f ]]; then source $f ; fi; done
fi
# set prompt colors and style
if [ -f ~/.PS1 ]; then
source ~/.PS1
else
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
fi
# fetch uninstalled package names when attempting command (arch only)
if [ -f /usr/share/doc/pkgfile/command-not-found.bash ]; then
source /usr/share/doc/pkgfile/command-not-found.bash
fi
if [ -d ~/.fzf ]; then
source ~/.fzf/completion.bash
source ~/.fzf/key-bindings.bash
fi
# source client specific scripts
if [ -d ~/.client ]; then
for f in ~/.client/.*; do if [[ -f $f ]]; then source $f ; fi; done
fi
# source: https://stackoverflow.com/a/44232192
PATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PATH}))')"
if [ "$XDG_SESSION_TYPE" == "wayland" ]; then
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland-egl
fi