[zsh] change config depending on user
This commit is contained in:
10
zsh/.zshrc
10
zsh/.zshrc
@@ -7,10 +7,16 @@ export PATH="$HOME/.local/bin:$PATH"
|
|||||||
[[ -f ~/.zsh/.local_config ]] && source ~/.zsh/.local_config
|
[[ -f ~/.zsh/.local_config ]] && source ~/.zsh/.local_config
|
||||||
[[ -f ~/.zsh/.os_config.zsh ]] && source ~/.zsh/.os_config.zsh
|
[[ -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
|
# Load Antidote
|
||||||
mkdir -p ${ZDOTDIR:-~}/.cache/zsh
|
mkdir -p ${ZDOTDIR:-~}/.cache/zsh
|
||||||
static_file=${ZDOTDIR:-~}/.cache/zsh/.zsh_plugins.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
|
plugins_txt=${ZDOTDIR:-~}/.zsh/.zsh_plugins.txt
|
||||||
# Vi mode
|
# Vi mode
|
||||||
bindkey -v
|
bindkey -v
|
||||||
@@ -64,7 +70,7 @@ ZLE_RPROMPT_INDENT=0
|
|||||||
|
|
||||||
# To customize prompt, run `p10k configure` or edit ~/dotfiles/zsh/.p10k.zsh.
|
# To customize prompt, run `p10k configure` or edit ~/dotfiles/zsh/.p10k.zsh.
|
||||||
function load_p10k() {
|
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
|
[[ ! -f ~/dotfiles/zsh/.p10k.zsh ]] || source ~/dotfiles/zsh/.p10k.zsh
|
||||||
else
|
else
|
||||||
[[ ! -f ~/dotfiles/zsh/.p10k_shared.zsh ]] || source ~/dotfiles/zsh/.p10k_shared.zsh
|
[[ ! -f ~/dotfiles/zsh/.p10k_shared.zsh ]] || source ~/dotfiles/zsh/.p10k_shared.zsh
|
||||||
|
|||||||
Reference in New Issue
Block a user