]> git.sev.monster Git - dotfiles.git/blame - base/.zshenv
major rework
[dotfiles.git] / base / .zshenv
CommitLineData
8d4a98e1 1export ZDOTDIR=${XDG_CONFIG_HOME:-~/.config}/zsh
2
833b2af3 3### load site-specific
8d4a98e1 4[[ -f ${ZDOTDIR:-~}/.zshenv.local ]] && source ${ZDOTDIR:-~}/.zshenv.local
79d4a356 5
833b2af3 6### fix broken term
8d4a98e1 7if [[ ! -v TERM ]] {
8 TERM=xterm-256color >/dev/null 2>&1
9}
6d54344e 10if [[ -o interactive && $#terminfo -eq 0 ]] {
11 _oldterm=$TERM
8d4a98e1 12 export TERM=xterm >/dev/null 2>&1
975ad64b 13 print -P "%F{red}!!! Can't find terminfo for $_oldterm, using $TERM%f"
6d54344e 14 unset _oldterm
833b2af3 15}
16
6d54344e 17if [[ -o login ]] {
18 ### cd on login shell for convenience
8d4a98e1 19 # NOTE: we do this here and not in .zprofile since we occasionally might
20 # re-source .zprofile, and it's easier to just put the logic here...
6d54344e 21 cd ~
22} else {
23 if [[ ! -v _sev_first_display && ( -v DISPLAY || -v WAYLAND_DISPLAY ) ]] {
8d4a98e1 24 ### update gpgagent to use graphical pinentry
6d54344e 25 # XXX: will be sourced by every new child shell if zsh is not used to
8d4a98e1 26 # start the graphical session and the _sev_first_disaply var isn't
27 # exported; for example, this happens with sway without a display
28 # manager or launcher in front of it
6d54344e 29 export _sev_first_display=
8d4a98e1 30 _sev_refresh_gpgagent= source ${ZDOTDIR:-~}/.zprofile
79d4a356 31 } elif [[ $SHLVL == 1 ]] {
8d4a98e1 32 ### early zprofile sourcing for first shell even if not a login shell
6d54344e 33 # NOTE: ensure profile is loaded for toplevel shells; should hopefully be 1
34 # under some Xorg or cron implementations, which is where this would be most useful
79d4a356 35 source ${ZDOTDIR:-~}/.zprofile
c3608beb 36 }
d569f3f7 37}
38
79d4a356 39# vim: et sts=4 sw=4 ts=8 tw=79
This page took 0.049402 seconds and 4 git commands to generate.