dotfiles/.profile

88 lines
2.6 KiB
Text
Raw Normal View History

2022-08-08 23:08:17 +02:00
# Executed by a login shell (e.g., bash, sh, or zsh) during start-up
# 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"
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
# 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
# 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"
export PIPX_HOME="$XDG_DATA_HOME/pipx"
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
# Convenience variables for easier access of some locations
2024-02-15 23:11:26 +01:00
export REPOS="$HOME/Repositories"
2022-08-10 13:55:23 +02:00
2022-08-08 23:08:17 +02:00
# Python-specific configs
export PIPX_BIN_DIR=$XDG_BIN_HOME
export PYENV_ROOT="$HOME/.pyenv"
2024-06-21 01:21:30 +02:00
# No need for *.pyc files (and __pycache__ folders) to be within project folders
# Note: `export PYTHONDONTWRITEBYTECODE=1` would disable them entirely
export PYTHONPYCACHEPREFIX=/tmp/pycache
2022-08-08 23:08:17 +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"
prepend-to-path "$PYENV_ROOT/bin"
2022-08-08 23:08:17 +02:00
# Shell-specific stuff
2022-08-08 23:59:31 +02:00
# zsh-specific stuff is automatically sourced from
# $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
# Source ~/.profile_local, which holds machine-specific ENV variables
if [ -f "$HOME/.profile_local" ]; then
source "$HOME/.profile_local"
fi