From 58d208c20458df8af3f3f4dcb8b19011710ba6ba Mon Sep 17 00:00:00 2001 From: juan Date: Sat, 16 Apr 2022 19:18:52 +0800 Subject: [PATCH] Update Zsh Home dir to XDG standard --- .zshrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 13dbab4..adcfc29 100644 --- a/.zshrc +++ b/.zshrc @@ -4,14 +4,15 @@ echo '\033[0;35m /w '$(awk -F "=" '/^NAME/ {print $2}' < /etc/os-release ) echo '\033[0;34m @ '$HOST #Install zinit if no zinit is present -if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then +ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" +if [[ ! -f $ZINIT_HOME/zinit.zsh ]]; then print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f" command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit" command git clone https://github.com/zdharma-continuum/zinit "$HOME/.zinit/bin" && \ print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \ print -P "%F{160}▓▒░ The clone has failed.%f%b" fi -source "$HOME/.zinit/bin/zinit.zsh" +source "$ZINIT_HOME/zinit.zsh" zinit ice lucid wait zinit light zdharma-continuum/fast-syntax-highlighting