.dotfiles/bash/bashrc

110 lines
3.4 KiB
Bash
Raw Permalink Normal View History

2022-04-16 19:54:07 +00:00
# vim: ft=sh
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# Use static SSH Agent from profile
export SSH_AUTH_SOCK=~/.ssh/ssh-agent.sock
# agetty is set to automatically log me in on tty1
# Automatically launch GUI on tty1 after login
2022-08-23 16:46:08 +00:00
if [ "$(tty)" == '/dev/tty1' ] && [ ! $SSH_TTY ]; then
2022-05-27 21:07:55 +00:00
. ${HOME}/.dotfiles/bash/bash_login
LAST_GUI=`cat ${HOME}/.spool/last_login_gui 2>/dev/null`
if [ -f "${HOME}/.spool/last_login_gui" ]; then
${HOME}/scripts/${LAST_GUI}/start${LAST_GUI}.sh
2022-04-16 19:54:07 +00:00
fi
fi
# Setup editor
2022-08-23 16:47:03 +00:00
export EDITOR="flatpak run io.neovim.nvim"
2022-04-16 19:54:07 +00:00
# don't put duplicate lines or lines starting with space in the history.
shopt -s histappend
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=500000
HISTFILESIZE=1000000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# enable programmable completion features
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# Set window title to last command
PROMPT_COMMAND='echo -e -n "\033]2;$_\007"'
2022-04-16 19:54:07 +00:00
# Reconfigure prompt after each return
PROMPT_COMMAND="$PROMPT_COMMAND; source ${HOME}/.dotfiles/bash/prompt.sh"
# Bell when prompt is returned to mark as urgent
PROMPT_COMMAND="$PROMPT_COMMAND;printf \"\a\"; history -a"
2022-04-16 19:54:07 +00:00
# Enable color support if possible
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
fi
# Load aliases
if [ -f ~/.dotfiles/bash/bash_aliases ]; then
. ~/.dotfiles/bash/bash_aliases
2022-04-16 19:54:07 +00:00
fi
# Add snaps and flatpaks to path
#export XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/local/share:/usr/share:/var/lib/snapd/desktop:/var/lib/flatpak/exports/share"
# Perl configs
PERL5LIB="${HOME}/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="${HOME}/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"${HOME}/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=${HOME}/perl5"; export PERL_MM_OPT;
2022-04-16 19:54:07 +00:00
# Configure PATH
source "$HOME/.dotfiles/bash/path"
2022-04-16 19:54:07 +00:00
# Standardize language
export LANG="en_US.UTF-8"
export LANGUAGE="en_US:en"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
# terminal type
export TERM="xterm"
# GUI options. Mostly to optimize Wayland
export QT_QPA_PLATFORM="wayland-egl;wayland;xcb"
export SDL_VIDEODRIVER="wayland"
export QML_IMPORT_PATH="/usr/lib/qt/qml"
export QT_PLUGIN_PATH="/usr/lib/qt/plugins"
export QML2_IMPORT_PATH="/usr/lib/qt/qml"
export MOZ_ENABLE_WAYLAND="1"
export MOZ_WEBRENDER="1"
export XDG_SESSION_TYPE="wayland"
export XDG_CURRENT_DESKTOP="sway"
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_DATA_DIRS="$XDG_DATA_DIRS:${HOME}/.config/flatpak/exports/share"
2022-06-07 12:06:58 +00:00
export SWAYSOCK=`sway --get-socketpath`
2022-04-16 19:54:07 +00:00
export CHROME_EXECUTABLE="/usr/bin/chromium"
export FLATPAK_IDE_LOG_LEVEL="0"
# Set initial title
echo -e -n "\033]2;Welcome to Bash\007"