From c9ab0b12d4183935113856f0c9c5575c8e149208 Mon Sep 17 00:00:00 2001 From: sev Date: Sun, 23 Jul 2023 18:39:23 -0500 Subject: [PATCH] zsh: compact path glob, avoid double source --- base/.zshenv | 3 ++- etc/zsh/.zlogin | 2 +- etc/zsh/.zprofile | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/base/.zshenv b/base/.zshenv index f6f0646..45ea339 100644 --- a/base/.zshenv +++ b/base/.zshenv @@ -24,7 +24,8 @@ if [[ ! -v _sev_first_display && ( -v DISPLAY || -v WAYLAND_DISPLAY ) ]] { # exported; for example, this previously happened with sway without a # display manager or launcher in front of it export _sev_first_display= - _sev_refresh_gpgagent= source ${ZDOTDIR:-~}/.zprofile + _sev_refresh_gpgagent= + [[ ! -o login ]] && source ${ZDOTDIR:-~}/.zprofile } elif [[ ! -o login && $SHLVL -eq 1 && ${+TERMUX_VERSION} -eq 0 ]] { ### early zprofile sourcing for first shell even if not a login shell source ${ZDOTDIR:-~}/.zprofile diff --git a/etc/zsh/.zlogin b/etc/zsh/.zlogin index 612209e..8b4aab6 100644 --- a/etc/zsh/.zlogin +++ b/etc/zsh/.zlogin @@ -4,4 +4,4 @@ if [[ -f ${ZDOTDIR:-~}/.zlogin.local ]] { source ${ZDOTDIR:-~}/.zlogin.local } ### cd for convenience -[[ -o login ]] && cd ${_sev_home:-~} +cd ${_sev_home:-~} diff --git a/etc/zsh/.zprofile b/etc/zsh/.zprofile index 9b93f41..ec88809 100644 --- a/etc/zsh/.zprofile +++ b/etc/zsh/.zprofile @@ -79,9 +79,7 @@ if [[ ! -v _sev_setup_path || -o login ]] { # XXX: XDG specifies ~/.local/bin as the only user-writable dir for # executables, but we specify more; technically this is against spec syspath=("$path[@]") - path=(~/{.local/,}{s,}bin - {~/.local,{$PREFIX,}{,/opt,/usr{,/local,pkg}}}/sbin - {~/.local,{$PREFIX,}{,/opt,/usr{,/local,pkg}}}/bin + path=({{${_sev_home:-~},~}{/.local,},{$PREFIX,}{,/opt,/usr{,/local,/pkg}}}/{s,}bin /usr/{X11R{7,6}/bin,games}) ((len=$#path)) path=("$path[@]" "$syspath[@]") -- 2.48.1