2016-04-01 11:45:17 +00:00
|
|
|
export LC_ALL=en_GB.UTF-8
|
2016-03-31 21:34:07 +00:00
|
|
|
export LANG=en_GB.UTF-8
|
|
|
|
export LC_NUMERIC=en_GB
|
2016-03-31 02:03:55 +00:00
|
|
|
|
2018-04-11 16:42:42 +00:00
|
|
|
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
|
|
|
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
|
|
|
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
|
|
|
export XDG_LOCAL_HOME="$HOME/.local"
|
2018-04-21 00:03:17 +00:00
|
|
|
|
|
|
|
mkdir -p "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME" "$XDG_DATA_HOME" "$XDG_LOCAL_HOME"
|
2018-04-11 16:42:42 +00:00
|
|
|
|
2018-03-29 13:00:57 +00:00
|
|
|
case "$(basename "$(readlink -f /proc/$$/exe)")" in
|
|
|
|
zsh) thisfile="$(readlink -f "${(%):-%N}")";;
|
|
|
|
bash) thisfile="$(readlink -f "${BASH_SOURCE[0]}")";;
|
2018-06-11 03:11:58 +00:00
|
|
|
*) thisfile="$(find /proc/$$/fd/ | xargs -n1 -r readlink -f | grep profile | head -n1)";;
|
2018-03-29 13:00:57 +00:00
|
|
|
esac
|
2016-03-31 02:03:55 +00:00
|
|
|
|
|
|
|
export EDITOR="vim"
|
|
|
|
export VISUAL="vim"
|
2018-11-20 15:40:49 +00:00
|
|
|
|
|
|
|
# Override paths for non-compliant programs
|
|
|
|
# https://wiki.archlinux.org/index.php/XDG_Base_Directory_support
|
|
|
|
|
2018-04-21 00:03:17 +00:00
|
|
|
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
2018-11-20 15:40:49 +00:00
|
|
|
export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
|
|
|
|
export GOPATH="$XDG_DATA_HOME/go"
|
|
|
|
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/settings.ini"
|
2018-12-28 13:58:50 +00:00
|
|
|
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc
|
2018-04-21 00:03:17 +00:00
|
|
|
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
|
2018-10-01 15:26:27 +00:00
|
|
|
export PYTHONHISTFILE="$XDG_DATA_HOME/python/histfile"
|
2018-11-20 15:40:49 +00:00
|
|
|
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
|
|
|
|
export TERMINFO="$XDG_DATA_HOME/terminfo"
|
|
|
|
export TERMINFO_DIRS="$XDG_DATA_HOME/terminfo:/usr/share/terminfo"
|
|
|
|
export VIMDIR="$XDG_CONFIG_HOME/vim"
|
|
|
|
export VIMRC="$VIMDIR/vimrc"
|
|
|
|
export VIMINIT=":so $VIMRC"
|
2018-10-30 13:17:11 +00:00
|
|
|
export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
|
2018-11-20 15:40:49 +00:00
|
|
|
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
|
|
|
|
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
|
2018-04-20 22:58:53 +00:00
|
|
|
|
2018-11-20 15:40:49 +00:00
|
|
|
export DOTFILES="$(dirname "${thisfile:-$XDG_CONFIG_HOME/dotfiles/.profile}")"
|
|
|
|
export PATH="${PATH}:/sbin:/usr/sbin:$DOTFILES/scripts:$GOPATH/bin"
|
2016-07-19 22:33:03 +00:00
|
|
|
|
2018-03-29 10:15:56 +00:00
|
|
|
exists() { which $@ 0<&- 1>/dev/null 2>/dev/null; }
|
|
|
|
|
2017-10-03 08:34:02 +00:00
|
|
|
# Source secret keys and values into environment
|
2018-04-11 16:42:42 +00:00
|
|
|
if [ -f "$XDG_CONFIG_HOME/secrets" ]; then
|
2017-10-03 08:34:02 +00:00
|
|
|
set -o allexport
|
2018-04-11 16:42:42 +00:00
|
|
|
source $XDG_CONFIG_HOME/secrets
|
2017-10-03 08:34:02 +00:00
|
|
|
set +o allexport
|
|
|
|
fi
|
|
|
|
|
2018-04-21 00:03:17 +00:00
|
|
|
# Start a dbus session daemon for programs that require it
|
2018-03-29 10:15:56 +00:00
|
|
|
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && exists dbus-launch; then
|
2017-07-08 23:09:12 +00:00
|
|
|
eval $(dbus-launch --sh-syntax --exit-with-session)
|
2018-08-21 12:35:50 +00:00
|
|
|
dbus-update-activation-environment --systemd \
|
2018-11-29 04:01:50 +00:00
|
|
|
DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY \
|
|
|
|
XDG_SEAT_PATH
|
2016-07-20 15:25:24 +00:00
|
|
|
fi
|
2017-11-03 00:28:18 +00:00
|
|
|
|