From 4d194d822f71dbbc772d46be5745d092697ab8e5 Mon Sep 17 00:00:00 2001 From: Fabian Ising Date: Wed, 8 Jan 2025 09:49:46 +0100 Subject: [PATCH] [zsh] change config depending on user --- zsh/.zshrc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index b83640c..42abee0 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -7,10 +7,16 @@ export PATH="$HOME/.local/bin:$PATH" [[ -f ~/.zsh/.local_config ]] && source ~/.zsh/.local_config [[ -f ~/.zsh/.os_config.zsh ]] && source ~/.zsh/.os_config.zsh +if [[ -f ~/.zsh/.shared_config ]] && [[ "$SUDO_USER" != "fabian" ]] ; then + shared_config=1 +else + shared_config=0 +fi + # Load Antidote mkdir -p ${ZDOTDIR:-~}/.cache/zsh static_file=${ZDOTDIR:-~}/.cache/zsh/.zsh_plugins.zsh -if [[ ! -f ~/.zsh/.shared_config ]]; then +if [ $shared_config -eq 0 ]; then plugins_txt=${ZDOTDIR:-~}/.zsh/.zsh_plugins.txt # Vi mode bindkey -v @@ -64,7 +70,7 @@ ZLE_RPROMPT_INDENT=0 # To customize prompt, run `p10k configure` or edit ~/dotfiles/zsh/.p10k.zsh. function load_p10k() { - if zmodload zsh/terminfo && (( terminfo[colors] >= 256 )) && [[ ! -f ~/.zsh/.shared_config ]]; then + if zmodload zsh/terminfo && (( terminfo[colors] >= 256 )) && [ $shared_config -eq 0 ]; then [[ ! -f ~/dotfiles/zsh/.p10k.zsh ]] || source ~/dotfiles/zsh/.p10k.zsh else [[ ! -f ~/dotfiles/zsh/.p10k_shared.zsh ]] || source ~/dotfiles/zsh/.p10k_shared.zsh