From d35ce3fbc2e36271c14366dae5e5161f09626e07 Mon Sep 17 00:00:00 2001 From: shokinn Date: Tue, 8 Feb 2022 11:53:29 +0100 Subject: [PATCH] Change fig placements in zshrc and zprofile; Add system arch based homebrew installation chooser --- dotfiles/z_profile | 14 ++++++++++++++ dotfiles/zshrc | 28 +++++++++++++++++++--------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/dotfiles/z_profile b/dotfiles/z_profile index 89473b0..6406345 100644 --- a/dotfiles/z_profile +++ b/dotfiles/z_profile @@ -1,3 +1,10 @@ +{%@@ if profile == 'VWAGWOY00349' @@%} +#### FIG ENV VARIABLES #### +# Please make sure this block is at the start of this file. +[ -s ~/.fig/shell/pre.sh ] && source ~/.fig/shell/pre.sh +#### END FIG ENV VARIABLES #### +{%@@ endif @@%} + # # {{@@ header() @@}} # @@ -28,3 +35,10 @@ export XDG_CONFIG_HOME # Run VPN-Kit alpine VM to route traffic through Windows and if connected through VPNs wsl.exe -d wsl-vpnkit service wsl-vpnkit start {%@@ endif @@%} + +{%@@ if profile == 'VWAGWOY00349' @@%} +#### FIG ENV VARIABLES #### +# Please make sure this block is at the end of this file. +[ -s ~/.fig/fig.sh ] && source ~/.fig/fig.sh +#### END FIG ENV VARIABLES #### +{%@@ endif @@%} diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 81b0e38..f562dd9 100644 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -1,14 +1,14 @@ -# -# {{@@ header() @@}} -# - {%@@ if profile == 'VWAGWOY00349' @@%} #### FIG ENV VARIABLES #### # Please make sure this block is at the start of this file. -[ -s {{@@ env['HOME'] @@}}/.fig/shell/pre.sh ] && source {{@@ env['HOME'] @@}}/.fig/shell/pre.sh +[ -s ~/.fig/shell/pre.sh ] && source ~/.fig/shell/pre.sh #### END FIG ENV VARIABLES #### {%@@ endif @@%} +# +# {{@@ header() @@}} +# + # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. # Initialization code that may require console input (password prompts, [y/n] # confirmations, etc.) must go above this block; everything else may go below. @@ -161,10 +161,13 @@ if [ -f "{{@@ env['HOME'] @@}}/.local/bin/pipx" ]; then fi {%@@ if profile == 'VWAGWOY00349' @@%} -#### FIG ENV VARIABLES #### -# Please make sure this block is at the end of this file. -[ -s {{@@ env['HOME'] @@}}/.fig/fig.sh ] && source {{@@ env['HOME'] @@}}/.fig/fig.sh -#### END FIG ENV VARIABLES #### +# Decide which homebrew installation (x64_86 / arm64) should be used +if [ "$(sysctl -n sysctl.proc_translated)" = "1" ]; then + local brew_path="/usr/local/homebrew/bin" +else + local brew_path="/opt/homebrew/bin" +fi +export PATH="${brew_path}:${PATH}" {%@@ endif @@%} # Functions (or more complex aliases) @@ -194,3 +197,10 @@ EOF curl http://wttr.in/${1} fi } + +{%@@ if profile == 'VWAGWOY00349' @@%} +#### FIG ENV VARIABLES #### +# Please make sure this block is at the end of this file. +[ -s ~/.fig/fig.sh ] && source ~/.fig/fig.sh +#### END FIG ENV VARIABLES #### +{%@@ endif @@%}