aboutsummaryrefslogblamecommitdiffstats
path: root/base/profile
blob: 0340623190577e46139719a11c199ad3a4c8fee5 (plain) (tree)
1
2
3
4
5
6
7
8

                      
            



                           
                     


                          

































                                                                           




                                                   
            














                                    
                                






                                         
                               



                                                
                           


                                       
# -*- 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
	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