My personal configuration files and scripts.
1# shellcheck shell=bash
2
3# These do not need to be explicitly set, but they are useful to reference here
4# and in scripts.
5export XDG_CONFIG_HOME="$HOME/.config"
6export XDG_DATA_HOME="$HOME/.local/share"
7export XDG_STATE_HOME="$HOME/.local/state"
8export XDG_CACHE_HOME="$HOME/.cache"
9
10# Here I try to wrangle misbehaving programs into complying with the XDG base
11# directories standard. A lot of these environment variables simply move the
12# program's catch-all directories from $HOME to $XDG_DATA_HOME, which while not
13# _entirely_ standards compliant, at least cleans up $HOME.
14export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
15export CARGO_HOME="$XDG_DATA_HOME/cargo"
16export GHCUP_USE_XDG_DIRS="yes"
17export STACK_ROOT="$XDG_DATA_HOME/stack"
18export MIX_XDG="true"
19export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
20export GOPATH="$XDG_DATA_HOME/go"
21export GOMODCACHE="$XDG_CACHE_HOME/go/mod"
22export IPYTHONDIR="$XDG_CONFIG_HOME/jupyter"
23export RUFF_CACHE_DIR="$XDG_CACHE_HOME/ruff"
24export PYLINTHOME="$XDG_CACHE_HOME/pylint"
25export TEXMFHOME="$XDG_DATA_HOME/texlive"
26export TEXMFCONFIG="$XDG_CONFIG_HOME/texlive"
27export TEXMFVAR="$XDG_CACHE_HOME/texlive"
28export GDBHISTORY="$XDG_DATA_HOME/gdb/history"
29export NODE_REPL_HISTORY="$XDG_DATA_HOME/node/history"
30export WGETRC="$XDG_CONFIG_HOME/wgetrc"
31export PARALLEL_HOME="$XDG_DATA_HOME/parallel"
32export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
33# One could argue that this should be in $XDG_CONFIG_HOME, but as far as I can
34# tell, these files are generated in a machine-specific way.
35export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=$XDG_DATA_HOME/java"
36
37# Prevent Go from automatically downloading a newer toolchain.
38export GOTOOLCHAIN="local"
39
40# Set the QMK repository location.
41export QMK_HOME="$HOME/Documents/Code/qmk"
42
43# Add the XDG BaseDir bin directory and the Cargo bin directory to $PATH.
44export PATH="$HOME/.local/bin:$CARGO_HOME/bin:$GOPATH/bin:$PATH"
45
46# Add the Rust toolchain man pages to $MANPATH.
47export MANPATH="$RUSTUP_HOME/toolchains/stable-x86_64-unknown-linux-gnu/share/man:$(manpath)"
48
49# Set default programs.
50export EDITOR="nvim"
51export VISUAL="$EDITOR"
52export DIFFPROG="nvim -d"
53export PAGER="less"
54
55# Configure less to use incremental search with smart case, decrease the tab
56# size, and quit if the content fits on one screen.
57export LESS="-R --incsearch --ignore-case --tabs=2 --quit-if-one-screen"
58
59if [[ "$(uname -n)" != "yggdrasill" ]]; then
60 # Direct programs that expect a Docker daemon socket to Podman's compatible
61 # stand-in.
62 export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/podman/podman.sock"
63else
64 # On my work laptop, I use Docker instead of Podman. Because of code of ours
65 # that relies on Docker Compose's old container naming scheme, the following
66 # needs to be set to revert to the old scheme.
67 export COMPOSE_COMPATIBILITY=1
68
69 export GL_HOST="gitlab.sitehost.co.nz"
70fi
71
72# This is not needed on GNOME as it includes its own agent.
73if [[ "$XDG_SESSION_DESKTOP" != "gnome" ]]; then
74 # Wire up the SSH agent for persisting SSH credentials.
75 export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
76fi
77
78# Improve font rendering in Java applications.
79export _JAVA_OPTIONS="$_JAVA_OPTIONS -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true"
80
81# Source ~/.bashrc if it exists.
82# shellcheck source=/home/severen/.bashrc
83[[ -f ~/.bashrc ]] && . ~/.bashrc
84
85# vim: ft=bash