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"
|
|
|
|
export XDG_CURRENT_DESKTOP="GNOME" # Fixes xdg-open
|
|
|
|
|
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]}")";;
|
|
|
|
*) thisfile="$(find /proc/$$/fd/ | xargs readlink -f | grep .profile | head -n1)";;
|
|
|
|
esac
|
2018-04-11 16:42:42 +00:00
|
|
|
export DOTFILES="$(dirname "${thisfile:-$XDG_CONFIG_HOME/dotfiles}")"
|
2016-03-31 02:03:55 +00:00
|
|
|
export PATH="${PATH}:$DOTFILES/scripts"
|
|
|
|
|
2017-11-23 19:15:43 +00:00
|
|
|
# Allow Vim to load from ~/.config/vim
|
2018-04-11 16:42:42 +00:00
|
|
|
export VIMDIR="$XDG_CONFIG_HOME/vim"
|
2017-12-18 16:53:43 +00:00
|
|
|
export MYVIMRC="$VIMDIR/vimrc"
|
2017-11-23 19:15:43 +00:00
|
|
|
export VIMINIT=":so $MYVIMRC"
|
2016-03-31 02:03:55 +00:00
|
|
|
export EDITOR="vim"
|
|
|
|
export VISUAL="vim"
|
2018-04-11 15:42:01 +00:00
|
|
|
|
|
|
|
# Allow ZSH to load from ~/.config/zsh
|
|
|
|
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
|
|
|
|
|
2018-04-11 16:42:42 +00:00
|
|
|
# Configure X11 config file paths
|
|
|
|
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority"
|
|
|
|
export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc"
|
|
|
|
export XSESSION="$XDG_CONFIG_HOME/X11/xsession"
|
|
|
|
|
2017-12-11 14:16:13 +00:00
|
|
|
export MANPAGER="less -+N"
|
2016-05-16 16:43:27 +00:00
|
|
|
export TERMINAL="termite"
|
2016-09-01 13:15:31 +00:00
|
|
|
export BROWSER="chromium"
|
2016-03-31 02:03:55 +00:00
|
|
|
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
|
2017-02-25 02:45:56 +00:00
|
|
|
export QT_QPA_PLATFORMTHEME=gtk2
|
2018-04-11 16:42:42 +00:00
|
|
|
export GOPATH="$XDG_LOCAL_HOME/go"
|
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; }
|
|
|
|
|
2018-03-29 14:57:51 +00:00
|
|
|
export LESS="-RI"
|
2018-02-27 01:38:51 +00:00
|
|
|
export PAGER="less $LESS"
|
2018-03-29 10:15:56 +00:00
|
|
|
if exists tput; then
|
|
|
|
export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green
|
|
|
|
export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan
|
|
|
|
export LESS_TERMCAP_me=$(tput sgr0)
|
|
|
|
export LESS_TERMCAP_so=$(tput bold; tput setaf 4) # blue
|
|
|
|
export LESS_TERMCAP_se=$(tput rmso; tput sgr0)
|
|
|
|
export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white
|
|
|
|
export LESS_TERMCAP_ue=$(tput rmul; tput sgr0)
|
|
|
|
export LESS_TERMCAP_mr=$(tput rev)
|
|
|
|
export LESS_TERMCAP_mh=$(tput dim)
|
|
|
|
export LESS_TERMCAP_ZN=$(tput ssubm)
|
|
|
|
export LESS_TERMCAP_ZV=$(tput rsubm)
|
|
|
|
export LESS_TERMCAP_ZO=$(tput ssupm)
|
|
|
|
export LESS_TERMCAP_ZW=$(tput rsupm)
|
|
|
|
fi
|
2018-02-27 01:38:51 +00:00
|
|
|
|
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
|
|
|
|
|
2016-08-26 20:32:31 +00:00
|
|
|
# Merge system clipboards
|
2018-03-30 09:49:33 +00:00
|
|
|
if [ -n "$DISPLAY" ] && exists autocutsel && ! pidof autocutsel 1>/dev/null; then
|
2017-11-17 13:09:58 +00:00
|
|
|
autocutsel -fork
|
|
|
|
autocutsel -selection PRIMARY -fork
|
2016-09-01 13:48:17 +00:00
|
|
|
fi
|
2016-08-26 20:32:31 +00:00
|
|
|
|
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)
|
|
|
|
dbus-update-activation-environment --systemd DISPLAY
|
2016-07-20 15:25:24 +00:00
|
|
|
fi
|
2017-11-03 00:28:18 +00:00
|
|
|
|
|
|
|
# Start the gnome-keyring if it's installed
|
2018-03-29 10:15:56 +00:00
|
|
|
if exists gnome-keyring-daemon; then
|
2017-11-03 00:28:18 +00:00
|
|
|
export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gnupg)
|
|
|
|
fi
|