2022-08-08 23:08:17 +02:00
|
|
|
# Executed by a login shell (e.g., bash, sh, or zsh) during start-up
|
|
|
|
|
|
|
|
|
2023-04-10 04:08:07 +02:00
|
|
|
|
|
|
|
# Shell-independent stuff
|
|
|
|
|
|
|
|
|
|
|
|
# Configure the standard XDG base directories
|
|
|
|
# Further Info: https://wiki.archlinux.org/title/XDG_Base_Directory
|
|
|
|
export XDG_CACHE_HOME="$HOME/.cache"
|
|
|
|
export XDG_CONFIG_HOME="$HOME/.config"
|
2023-04-10 18:03:34 +02:00
|
|
|
export XDG_DATA_HOME="$HOME/.local/share" # also set temporarily in $XDG_DATA_HOME/dotfiles/setup.sh
|
|
|
|
export XDG_STATE_HOME="$HOME/.local/state" # also set temporarily in $XDG_DATA_HOME/dotfiles/setup.sh
|
2023-04-11 00:33:39 +02:00
|
|
|
# Make up a XDG directory for binaries (that does not exist in the standard)
|
|
|
|
export XDG_BIN_HOME="$HOME/.local/bin" # also set temporarily in $XDG_DATA_HOME/dotfiles/setup.sh
|
|
|
|
|
2023-04-10 04:08:07 +02:00
|
|
|
|
|
|
|
# Move common tools' config and cache files into XDG directories
|
|
|
|
export BAT_CONFIG_PATH="$XDG_CONFIG_PATH/bat/config"
|
|
|
|
export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
|
|
|
|
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
|
|
|
export LESSHISTFILE="$XDG_STATE_HOME/less/history"
|
|
|
|
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
|
2023-04-11 00:33:39 +02:00
|
|
|
export PIPX_HOME="$XDG_DATA_HOME/pipx"
|
2023-04-10 04:08:07 +02:00
|
|
|
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc"
|
|
|
|
export PSQLRC="$XDG_CONFIG_HOME/psql/psqlrc"
|
|
|
|
export SSB_HOME="$XDG_DATA_HOME"/zoom
|
|
|
|
export VIMINIT="source $XDG_CONFIG_HOME/vim/vimrc"
|
|
|
|
|
|
|
|
|
|
|
|
# Generic shell configs
|
2022-08-09 01:16:07 +02:00
|
|
|
export EDITOR=vim
|
2022-08-08 23:08:17 +02:00
|
|
|
export PAGER='less --chop-long-lines --ignore-case --LONG-PROMPT --no-init --status-column --quit-if-one-screen'
|
|
|
|
export TERM=xterm-256color
|
|
|
|
export TZ='Europe/Berlin'
|
2022-08-09 01:16:07 +02:00
|
|
|
export VISUAL=$EDITOR
|
2022-08-08 23:08:17 +02:00
|
|
|
|
|
|
|
|
2023-04-10 04:08:07 +02:00
|
|
|
# Convenience variables for easier access of some locations
|
|
|
|
export REPOS="$HOME/repos"
|
2022-08-10 13:55:23 +02:00
|
|
|
|
2022-08-08 23:08:17 +02:00
|
|
|
|
2023-04-10 04:08:07 +02:00
|
|
|
# Python-specific configs
|
2023-04-11 00:33:39 +02:00
|
|
|
export PIPX_BIN_DIR=$XDG_BIN_HOME
|
2022-08-09 13:53:43 +02:00
|
|
|
export PYENV_ROOT="$HOME/.pyenv"
|
|
|
|
# No need for *.pyc files on a dev machine
|
|
|
|
export PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
2022-08-08 23:08:17 +02:00
|
|
|
|
2023-04-10 04:08:07 +02:00
|
|
|
# Put local binaries on the $PATH
|
2022-08-08 23:08:17 +02:00
|
|
|
prepend-to-path () { # if not already there
|
|
|
|
if [ -d "$1" ] ; then
|
|
|
|
case :$PATH: in
|
|
|
|
*:$1:*) ;;
|
|
|
|
*) PATH=$1:$PATH ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
prepend-to-path "$HOME/bin"
|
|
|
|
prepend-to-path "$HOME/.local/bin"
|
2022-08-09 13:53:43 +02:00
|
|
|
prepend-to-path "$PYENV_ROOT/bin"
|
2022-08-08 23:08:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Shell-specific stuff
|
|
|
|
|
2023-04-10 04:08:07 +02:00
|
|
|
|
2022-08-08 23:59:31 +02:00
|
|
|
# zsh-specific stuff is automatically sourced from
|
2023-04-10 04:08:07 +02:00
|
|
|
# $XDG_CONFIG_HOME/zsh/.zshenv, $XDG_CONFIG_HOME/zsh/.zprofile,
|
|
|
|
# $XDG_CONFIG_HOME/zsh/.zlogin, and $XDG_CONFIG_HOME/.zshrc
|
|
|
|
|
2022-08-08 23:59:31 +02:00
|
|
|
|
2022-08-08 23:08:17 +02:00
|
|
|
# Source ~/.bashrc if we are running inside a bash shell
|
|
|
|
# because it is NOT automatically sourced by bash
|
|
|
|
if [ -n "$BASH_VERSION" ]; then
|
|
|
|
if [ -f "$HOME/.bashrc" ]; then
|
|
|
|
source "$HOME/.bashrc"
|
|
|
|
fi
|
|
|
|
fi
|