dotfiles/.profile
Alexander Hess 13b8724696
Move everything possible into XDG directories
With the help of xdg-ninja (https://github.com/b3nj5m1n/xdg-ninja)
we move all kinds of config/cache files into the XDG directories
2023-05-01 02:22:39 +02:00

75 lines
2.1 KiB
Bash

# 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 ~/.config/shell/init_dotfiles.sh
export XDG_STATE_HOME="$HOME/.local/state" # also set temporarily in ~/.config/shell/init_dotfiles.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 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
export EDITOR=vim
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'
export VISUAL=$EDITOR
# Convenience variables for easier access of some locations
export REPOS="$HOME/repos"
# Python-specific configs
export PYENV_ROOT="$HOME/.pyenv"
# No need for *.pyc files on a dev machine
export PYTHONDONTWRITEBYTECODE=1
# Put local binaries on the $PATH
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"
# Shell-specific stuff
# 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
# 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