aboutsummaryrefslogtreecommitdiffstats
path: root/base/user-profile
diff options
context:
space:
mode:
Diffstat (limited to 'base/user-profile')
-rw-r--r--base/user-profile86
1 files changed, 86 insertions, 0 deletions
diff --git a/base/user-profile b/base/user-profile
new file mode 100644
index 0000000..2206a1f
--- /dev/null
+++ b/base/user-profile
@@ -0,0 +1,86 @@
+# -*- 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
+
+# Set man section order
+export MANSECT="1p:8p:1:8:2:3p:3:0:5:4:9:6:7:n:l"
+
+# 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
+ export EDITOR="emacs -nw"
+elif test -x /usr/bin/vis; then
+ export EDITOR="vis"
+elif test -x /usr/bin/nano; then
+ export EDITOR="nano"
+elif test -x /usr/bin/vim; then
+ export EDITOR="vim"
+elif test -x /usr/bin/vi; then
+ export EDITOR="vi"
+fi
+export VISUAL="${EDITOR}"
+
+# Load package specific profiles
+for __script in ~/.config/profile.d/*; do
+ if test -r "${__script}"; then
+ . "${__script}"
+ fi
+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