From 51ce30df96ab446c76d6ae5c7964a318ccb39ae8 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 22 Jan 2022 18:41:08 -0500 Subject: [PATCH] ENH move all environment stuff to manual shell functions --- dot_config/X11/xinitrc | 4 ---- dot_config/zsh/dot_zshrc.tmpl | 6 ++++++ dot_pam_environment.tmpl | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dot_config/X11/xinitrc b/dot_config/X11/xinitrc index 21310ef..b9842ba 100644 --- a/dot_config/X11/xinitrc +++ b/dot_config/X11/xinitrc @@ -5,10 +5,6 @@ userresources="$XDG_CONFIG_HOME/X11/xresources" systemctl --user import-environment PATH systemctl --user import-environment DISPLAY -# add gempath to PATH -gempaths="$(/usr/bin/gem env gempath):" -export PATH="${gempaths//:/\/bin:}:$PATH" - if [ -f "$userresources" ]; then xrdb -merge "$userresources" fi diff --git a/dot_config/zsh/dot_zshrc.tmpl b/dot_config/zsh/dot_zshrc.tmpl index f10c7e3..7353a44 100644 --- a/dot_config/zsh/dot_zshrc.tmpl +++ b/dot_config/zsh/dot_zshrc.tmpl @@ -59,6 +59,8 @@ x11-clip-wrap-widgets paste $paste_widgets # magic to automatically call the shims zsh-pyenv () { + export PATH=$PYENV_ROOT/shims:$PATH + if command -v pyenv 1>/dev/null 2>&1; then echo "Activating pyenv" eval "$(pyenv init - | sed '/PATH/d' -)" @@ -70,6 +72,10 @@ zsh-pyenv () { zsh-rbenv () { + gempaths="$(/usr/bin/gem env gempath):" + export PATH="${gempaths//:/\/bin:}:$PATH" + export PATH=$RBENV_ROOT/shims:$PATH + if command -v rbenv 1>/dev/null 2>&1; then echo "Activating rbenv" eval "$(rbenv init - | sed '/PATH/d' -)" diff --git a/dot_pam_environment.tmpl b/dot_pam_environment.tmpl index 42b3820..81ca4dc 100644 --- a/dot_pam_environment.tmpl +++ b/dot_pam_environment.tmpl @@ -68,7 +68,7 @@ PASSWORD_STORE_DIR DEFAULT=${GNUPGHOME}/pass # Path #--------------------# -PATH OVERRIDE={{- if eq .chezmoi.hostname "petrucci4prez" }}${RBENV_ROOT}/shims:${PYENV_ROOT}/shims:{{- end }}@{HOME}/.bin:@{HOME}/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin +PATH OVERRIDE=@{HOME}/.bin:@{HOME}/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin #--------------------# # Applications