38 lines
1 KiB
Text
38 lines
1 KiB
Text
|
|
#!/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/dotfiles-{install,update}
|
||
|
|
export XDG_STATE_HOME="$HOME/.local/state"
|
||
|
|
|
||
|
|
# Make up a XDG directory for binaries (that does not exist in the standard)
|
||
|
|
export XDG_BIN_HOME="$HOME/.local/bin"
|
||
|
|
|
||
|
|
|
||
|
|
# Convenient names for various places in the system
|
||
|
|
|
||
|
|
export DOTFILES_DIR="$XDG_DATA_HOME/dotfiles" # also set in ~/.local/bin/dotfiles-{install,update}
|
||
|
|
|
||
|
|
|
||
|
|
# Generic shell configs
|
||
|
|
|
||
|
|
|
||
|
|
[ -t 0 ] && export GPG_TTY=$(tty)
|
||
|
|
|
||
|
|
|
||
|
|
export PAGER=less
|
||
|
|
export LESS="--chop-long-lines --ignore-case --LONG-PROMPT --no-init --raw-control-chars --status-column --quit-if-one-screen"
|
||
|
|
|
||
|
|
|
||
|
|
[ -f "$XDG_CONFIG_HOME/shell/locale" ] && . "$XDG_CONFIG_HOME/shell/locale"
|
||
|
|
|
||
|
|
|
||
|
|
# Move common tools' config and cache files into XDG directories
|
||
|
|
|
||
|
|
export LESSHISTFILE="$XDG_STATE_HOME/less/history"
|