aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--base/profile40
1 files changed, 40 insertions, 0 deletions
diff --git a/base/profile b/base/profile
index 4410d8e..0340623 100644
--- a/base/profile
+++ b/base/profile
@@ -1,17 +1,54 @@
# -*- shell-script -*-
+# Set locale
export LOCALE="en_GB.UTF-8"
export LC_ALL="en_GB.UTF-8"
export LANG="en_GB.UTF-8"
+# Set audio interface
export MAIN_ALSA_CARD=0
export MAIN_ALSA_MIXER=PCM
+# Ensure ~/.local/bin and ~/.usr/bin are in PATH
+if ( IFS=: ; printf '%s\n' $PATH ) | grep -Fx ~/.local/bin >/dev/null; then
+ export PATH="${HOME}/.local/bin:${PATH}"
+fi
+if ( IFS=: ; printf '%s\n' $PATH ) | grep -Fx ~/.usr/bin >/dev/null; then
+ export PATH="${HOME}/.usr/bin:${PATH}"
+fi
+
+# Maybe set user directories
+if test -z "${XDG_CONFIG_HOME}"; then
+ export XDG_CONFIG_HOME="${HOME}/.config"
+fi
+if test -z "${XDG_CACHE_HOME}"; then
+ export XDG_CACHE_HOME="${HOME}/.var/cache"
+fi
+if test -z "${XDG_SPOOL_HOME}"; then
+ export XDG_SPOOL_HOME="${HOME}/.var/spool"
+fi
+if test -z "${XDG_STATE_HOME}"; then
+ export XDG_STATE_HOME="${HOME}/.var/lib"
+fi
+if test -z "${XDG_DATA_HOME}"; then
+ export XDG_DATA_HOME="${HOME}/.local/share"
+fi
+
+# Maybe set system directories
+if test -z "${XDG_DATA_DIRS}"; then
+ export XDG_DATA_DIRS="/usr/local/share:/usr/share"
+fi
+if test -z "${XDG_CONFIG_DIRS}"; then
+ export XDG_CONFIG_DIRS="/etc/xgd:/etc"
+fi
+
+# Maybe set directory for temporary files, atleast create it
if test -z "${XDG_RUNTIME_DIR}"; then
export XDG_RUNTIME_DIR='/tmp/.~'"$(whoami)"
fi
mkdir -p -- "${XDG_RUNTIME_DIR}"
+# Set editor
if test -x ~/.local/bin/e; then
export EDITOR=~/.local/bin/e
elif test -x /usr/bin/emacs; then
@@ -27,6 +64,7 @@ elif test -x /usr/bin/vi; then
fi
export VISUAL="${EDITOR}"
+# Load package specific profiles
for __script in ~/.config/profile.d/*; do
if test -r "${__script}"; then
. "${__script}"
@@ -34,10 +72,12 @@ for __script in ~/.config/profile.d/*; do
done
unset __script
+# Load machine specific profile
if test -r ~/.config/"profile-$(hostname)"; then
. ~/.config/"profile-$(hostname)"
fi
+# Load work related profile
if test -r ~/work/.config/profile; then
. ~/work/.config/profile
fi