diff --git a/config/dotwryn.env.zsh b/config/dotwryn.env.zsh index 105f273..86ad4d1 100644 --- a/config/dotwryn.env.zsh +++ b/config/dotwryn.env.zsh @@ -3,13 +3,17 @@ ##################################################################### export DOTWRYN="$HOME/.wryn" - export SOURCE_PACKAGES="$HOME/.local/share/source-packages" -export DOTWRYN_UTILS="$DOTWRYN/zsh/plugins/scwrypts/zsh/lib/utils/utils.module.zsh" - -RELOAD_ZSH_UTILS() { source $DOTWRYN_UTILS; } -[ ! $DOTWRYN_UTILS_LOADED ] && RELOAD_ZSH_UTILS && export DOTWRYN_UTILS_LOADED=1 +LOAD_ZSH_UTILS() { + local SCWRYPTS_ROOT="$(scwrypts --root 2>/dev/null)" + : \ + && [ $SCWRYPTS_ROOT ] \ + && [ -d "$SCWRYPTS_ROOT" ] \ + && source "$(scwrypts --root)/zsh/lib/utils/utils.module.zsh" \ + && export DOTWRYN_UTILS_LOADED=1 +} +[ $DOTWRYN_UTILS_LOADED ] || RELOAD_ZSH_UTILS ##################################################################### ### Application Settings ############################################ @@ -18,7 +22,6 @@ RELOAD_ZSH_UTILS() { source $DOTWRYN_UTILS; } export PREFERRED_EDITOR=(vim vi) RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/config" -TMUX_DEFAULT_SESSION_NAME='wryn' PS1_BRANCH_SYMBOL='' PS1_INDICATOR_SYMBOL='☕' @@ -42,7 +45,6 @@ EXTERNAL_PLUGINS+=( export FZF_DEFAULT_OPTS='--reverse --ansi --height 50% --bind=ctrl-c:cancel' export FZF_DEFAULT_COMMAND='rg --files' - # fzf-tab EXTERNAL_PLUGINS+=("$DOTWRYN/zsh/plugins/fzf-tab/fzf-tab.plugin.zsh") @@ -50,9 +52,8 @@ zstyle ':fzf-tab:*' accept-line enter zstyle ':fzf-tab:*' fzf-bindings 'space:accept' ';:toggle' zstyle ':fzf-tab:*' continuous-trigger '/' - # scwrypts -EXTERNAL_PLUGINS+=("$DOTWRYN/zsh/plugins/scwrypts/scwrypts.plugin.zsh") +EXTERNAL_PLUGINS+=("$(scwrypts --root 2>/dev/null)/scwrypts.plugin.zsh") for e in \ "local.$(hostnamectl --static).secret" \ @@ -60,14 +61,11 @@ for e in \ "local" do export SCWRYPTS_ENV="$e"; [ -f "$HOME/.config/scwrypts/environments/scwrypts/$e" ] && break; done - # z EXTERNAL_PLUGINS+=("$DOTWRYN/zsh/plugins/z/z.sh") - # code-activator EXTERNAL_PLUGINS+=("$DOTWRYN/zsh/plugins/code-activator/activator.plugin.zsh") - # ssh EXTERNAL_PLUGINS+=("$DOTWRYN/zsh/plugins/ssh/ssh.plugin.zsh")