summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/aliasrc4
-rw-r--r--.config/bashrc7
2 files changed, 11 insertions, 0 deletions
diff --git a/.config/aliasrc b/.config/aliasrc
new file mode 100644
index 0000000..ff96ea0
--- /dev/null
+++ b/.config/aliasrc
@@ -0,0 +1,4 @@
+# The $HOME directory is the working directory for the bare dotfiles git repo.
+# As such we can't use the git command in this directory if we want to work with the repo.
+# Instead the dotfiles alias is used.
+alias dotfiles='/usr/bin/git --git-dir=$HOME/.local/src/ --work-tree=$HOME'
diff --git a/.config/bashrc b/.config/bashrc
index 558cc76..1207f13 100644
--- a/.config/bashrc
+++ b/.config/bashrc
@@ -8,3 +8,10 @@
# Adds `~/.local/bin` to $PATH
export PATH="$PATH:$(du "$HOME/.local/bin/" | cut -f2 | paste -sd ':')"
+# Keep the home directory tidy.
+export XDG_CONFIG_HOME="$HOME/.config"
+export XDG_DATA_HOME="$HOME/.local/share"
+export XDG_CACHE_HOME="$HOME/.cache"
+
+# Load aliases if they exist.
+[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/aliasrc"