dotfiles/files/.bashrc

74 lines
2.2 KiB
Bash
Raw Normal View History

2022-12-17 00:37:53 -05: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
2023-02-03 23:21:16 -05:00
# history settings
2023-02-01 01:12:30 -05:00
HISTSIZE=5000
HISTFILESIZE=10000
2023-02-03 23:21:16 -05:00
2023-02-01 01:12:30 -05:00
shopt -s histappend
2023-02-03 23:21:16 -05:00
2023-02-01 05:13:27 -05:00
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
2023-02-01 01:12:30 -05:00
2023-02-03 23:08:35 -05:00
export HISTCONTROL=erasedups
2022-12-17 00:37:53 -05:00
# 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
2023-02-03 23:25:38 -05:00
# automatically prepend cd when entering just a path in the shell
shopt -s autocd
2022-12-17 00:37:53 -05:00
# set a fancy prompt (non-color, unless we know we "want" color)
2022-12-27 19:12:25 -05:00
export TERM=xterm-color
2022-12-17 00:37:53 -05:00
# Alias definitions.
2023-02-26 01:36:59 -05:00
[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
2022-12-17 00:37:53 -05:00
# set PATH so it includes user's private bin if it exists
2023-02-26 01:41:29 -05:00
[[ -d "$HOME/bin" ]] && PATH+=":$HOME/bin"
[[ -d "$HOME/.local/bin" ]] && PATH+=":$HOME/.local/bin"
2023-04-03 11:24:48 -04:00
[[ -d "$HOME/scipts/bin" ]] && PATH+=":$HOME/scripts/bin"
2023-04-03 11:26:54 -04:00
=======
2023-03-26 01:38:35 -04:00
# set PATH so it includes certain bin folders if they exist
[[ -d ~/bin ]] && PATH+=":$HOME/bin"
[[ -d ~/.local/bin ]] && PATH+=":$HOME/.local/bin"
[[ -d /usr/local/go/bin ]] && PATH+=":/usr/local/go/bin"
2023-04-03 11:26:54 -04:00
>>>>>>> 574ac34e491aaaad429e0df90280e7a0b5e8c7f5
2022-12-17 00:37:53 -05:00
2023-02-04 00:50:10 -05:00
# source misc user scripts
2023-02-07 00:27:15 -05:00
if [ -d ~/git/dotfiles/source ]; then
2023-02-04 01:38:41 -05:00
for f in ~/git/dotfiles/source/.*; do if [[ -f $f ]]; then source $f ; fi; done
2023-02-04 01:38:11 -05:00
fi
2022-12-28 15:38:02 -05:00
2023-02-03 23:21:16 -05:00
# set prompt colors and style
2023-03-26 01:32:49 -04:00
[[ -f ~/.PS1 ]] && . ~/.PS1 ||
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
2023-01-23 08:45:00 -05:00
2023-02-03 23:21:16 -05:00
# fetch uninstalled package names when attempting command (arch only)
2023-03-26 01:32:49 -04:00
PKG_COMP=/usr/share/doc/pkgfile/command-not-found.bash
2023-03-26 01:33:25 -04:00
[[ -f $PKG_COMP ]] && . $PKG_COMP
2023-02-07 00:27:15 -05:00
2023-03-26 01:38:35 -04:00
# source fzf scripts
2023-02-07 00:50:21 -05:00
if [ -d ~/.fzf ]; then
2023-02-07 00:42:00 -05:00
source ~/.fzf/completion.bash
source ~/.fzf/key-bindings.bash
2023-02-07 00:27:15 -05:00
fi
2023-02-07 22:59:10 -05:00
# source client specific scripts
if [ -d ~/.client ]; then
for f in ~/.client/.*; do if [[ -f $f ]]; then source $f ; fi; done
fi
2023-02-26 01:49:25 -05:00
# source: https://stackoverflow.com/a/44232192
PATH="$(perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, $ENV{PATH}))')"
2023-03-11 12:01:01 -05:00
if [ "$XDG_SESSION_TYPE" == "wayland" ]; then
2023-03-11 12:57:58 -05:00
export MOZ_ENABLE_WAYLAND=1
2023-03-11 13:22:53 -05:00
export QT_QPA_PLATFORM=wayland-egl
2023-03-11 12:01:01 -05:00
fi