2026-06-11 18:28:00 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
# Environment variables for all kinds of shells
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Standard XDG base directories
|
|
|
|
|
# See: 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 in ~/.local/bin/install-dotfiles
|
|
|
|
|
export XDG_STATE_HOME="$HOME/.local/state"
|
|
|
|
|
|
|
|
|
|
# Make up a XDG directory for binaries (that does not exist in the standard)
|
2026-08-03 02:57:48 +02:00
|
|
|
export XDG_BIN_HOME="$HOME/.local/bin" # also set in ~/.local/bin/install-dotfiles
|
2026-06-11 18:28:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# Convenient names for various places in the system
|
|
|
|
|
|
|
|
|
|
export DOTFILES_DIR="$XDG_DATA_HOME/dotfiles" # also set in ~/.local/bin/install-dotfiles
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Generic shell configs
|
|
|
|
|
|
2026-08-03 02:02:37 +02:00
|
|
|
export EDITOR=vim
|
2026-06-11 18:28:00 +02:00
|
|
|
export GPG_TTY=$(tty)
|
|
|
|
|
export PAGER="less --chop-long-lines --ignore-case --LONG-PROMPT --no-init --status-column --quit-if-one-screen"
|
2026-08-03 04:00:21 +02:00
|
|
|
export PYTHONDONTWRITEBYTECODE=1
|
2026-06-11 18:28:00 +02:00
|
|
|
export TZ="Europe/Berlin"
|
2026-08-03 02:02:37 +02:00
|
|
|
export VISUAL=$EDITOR
|
2026-06-11 18:28:00 +02:00
|
|
|
|
2026-08-03 02:57:48 +02:00
|
|
|
if command -v bat >/dev/null 2>&1; then
|
|
|
|
|
export MANPAGER="sh -c 'col -bx | bat --language man --plain'"
|
|
|
|
|
export MANROFFOPT="-c"
|
|
|
|
|
fi
|
|
|
|
|
|
2026-06-11 18:28:00 +02:00
|
|
|
|
|
|
|
|
# Move common tools' config and cache files into XDG directories
|
|
|
|
|
|
2026-08-03 02:57:48 +02:00
|
|
|
export BAT_CONFIG_PATH="$XDG_CONFIG_HOME/bat/config"
|
2026-06-11 18:28:00 +02:00
|
|
|
export LESSHISTFILE="$XDG_STATE_HOME/less/history"
|
2026-08-03 03:33:26 +02:00
|
|
|
export PSQLRC="$XDG_CONFIG_HOME/psql/psqlrc"
|
2026-08-03 04:00:21 +02:00
|
|
|
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
|
|
|
|
|
export PYTHON_HISTORY="$XDG_STATE_HOME/python/history"
|
|
|
|
|
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py"
|
2026-08-03 02:02:37 +02:00
|
|
|
export VIMINIT='let $MYVIMRC="'"$XDG_CONFIG_HOME"'/vim/vimrc" | source $MYVIMRC'
|