X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/186423fe66144fbe2335fd9ca716fdea6cb55712..8eb81f95a10b12c52faa4fcdeb1e4941f02e3050:/base/.zprofile diff --git a/base/.zprofile b/base/.zprofile index 425a48c..82e70e4 100644 --- a/base/.zprofile +++ b/base/.zprofile @@ -1,14 +1,65 @@ -#XXX: ensure we override /etc/profile, gets loaded after .zshenv -source ~/.zshenv +### general exports +export EDITOR=vim +export PAGER=less +## lang +export CHARSET=UTF-8 +export LANG="en_US.UTF-8" +export LC_CTYPE="$LANG" +## histfile +export HISTFILE=~/.histfile +export HISTSIZE=1000 +export SAVEHIST=1000 +## path +# /usr/{pkg,local,games} are unix/bsdisms +typeset -U PATH path +path=({~/,/,/usr/}sbin {~/,/,/usr/}bin /usr/pkg/{s,}bin /usr/X11R{7,6}/bin + /usr/local/{s,}bin /usr/games "${path[@]}") +export PATH +typeset -U FPATH fpath +fpath=(~/.zsh/functions/Prompts "${fpath[@]}") +export FPATH -t="/tmp/home-$LOGNAME" +### applications +## python +export PYTHONSTARTUP=~/.pythonrc +## perl +(( ${+commands[perl]} )) && eval $(perl -I $XDG_DATA_HOME/perl5/lib/perl5 -Mlocal::lib=$XDG_DATA_HOME/perl5 2>/dev/null) +## gpg +if (( ${+commands[gpg]} )) { + # SSH_AUTH_SOCK should be set in a remote SSH session for passthrough + # if it isn't, we are likely the first login shell on the local machine + if [[ ! -v SSH_AUTH_SOCK ]] { + export GPG_TTY=$(tty) + gpg-connect-agent UPDATESTARTUPTTY /bye >/dev/null + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + } +} +## xdg +export XDG_CONFIG_HOME=~/etc +export XDG_CONFIG_DIRS=~/.config:/usr/pkg/etc/xdg:/usr/local/etc/xdg:/etc/xdg +export XDG_DATA_HOME=~/share +export XDG_DATA_DIRS=~/.local/share:/usr/pkg/share:/usr/local/share:/usr/share +export XDG_CACHE_HOME=~/tmp +export XDG_RUNTIME_DIR=~/tmp +## grep +# XXX: deprecated in GNU +export GREP_OPTIONS=--color=auto + +### tmp +t="${TMPDIR:-/tmp}/home-$LOGNAME" h="$HOME/tmp" if [[ ! -e "$t" ]] { - mkdir -m 700 "$t" > /dev/null 2>&1 + mkdir -m 700 "$t" > /dev/null 2>&1 + #TODO: check if dir exists after mkdir } -#allow opaque entries to override +#allow opaque entries to override link creation if [[ ! -e "$h" ]] { - ln -sf "$t" "$h" > /dev/null 2>&1 + ln -sf "$t" "$h" > /dev/null 2>&1 } unset t unset h + +### load site-specific +if [[ -f ~/.zprofile.local ]] { source ~/.zprofile.local } + +# vim: set et sts=4 sw=4 ts=8 tw=79 :