individual zsh configuration
This commit is contained in:
@@ -33,9 +33,9 @@ if ! command -v starship >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
# Path
|
||||
PATH_OHMYZSH="$HOME"/.oh-my-zsh
|
||||
PATH_OHMYZSH_CUSTOM_PLUGINS="$PATH_OHMYZSH"/custom/plugins
|
||||
PATH_OHMYZSH_CUSTOM_THEMES="$PATH_OHMYZSH"/custom/themes
|
||||
PATH_OHMYZSH="$HOME/.oh-my-zsh"
|
||||
PATH_OHMYZSH_CUSTOM_PLUGINS="$PATH_OHMYZSH/custom/plugins"
|
||||
PATH_OHMYZSH_CUSTOM_THEMES="$PATH_OHMYZSH/custom/themes"
|
||||
|
||||
# git clone oh-my-zsh
|
||||
if [ ! -d "$PATH_OHMYZSH" ]; then
|
||||
@@ -103,17 +103,39 @@ else
|
||||
fi
|
||||
|
||||
# git clone powerlevel10k
|
||||
if [ ! -d "$PATH_OHMYZSH_CUSTOM_THEMES"/powerlevel10k ]; then
|
||||
echo "Powerlevel10k is not downloaded. Downloading..."
|
||||
# git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "$PATH_OHMYZSH_CUSTOM_THEMES"/powerlevel10k
|
||||
git clone --depth=1 https://gitee.com/gwbeip/powerlevel10k.git "$PATH_OHMYZSH_CUSTOM_THEMES"/powerlevel10k
|
||||
else
|
||||
cd "$PATH_OHMYZSH_CUSTOM_THEMES/powerlevel10k" || exit 1
|
||||
if [ ! -d .git ]; then
|
||||
echo "Zsh Autocomplete is not a git repository. Please remove $PATH_OHMYZSH_CUSTOM_THEMES/powerlevel10k and try again."
|
||||
exit 1
|
||||
# if [ ! -d "$PATH_OHMYZSH_CUSTOM_THEMES"/powerlevel10k ]; then
|
||||
# echo "Powerlevel10k is not downloaded. Downloading..."
|
||||
# # git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "$PATH_OHMYZSH_CUSTOM_THEMES"/powerlevel10k
|
||||
# git clone --depth=1 https://gitee.com/gwbeip/powerlevel10k.git "$PATH_OHMYZSH_CUSTOM_THEMES"/powerlevel10k
|
||||
# else
|
||||
# cd "$PATH_OHMYZSH_CUSTOM_THEMES/powerlevel10k" || exit 1
|
||||
# if [ ! -d .git ]; then
|
||||
# echo "Zsh Autocomplete is not a git repository. Please remove $PATH_OHMYZSH_CUSTOM_THEMES/powerlevel10k and try again."
|
||||
# exit 1
|
||||
# else
|
||||
# echo "Powerlevel10k is already exist. Updating..."
|
||||
# git pull
|
||||
# fi
|
||||
# fi
|
||||
|
||||
|
||||
# copying $HOME/.zshrc
|
||||
current_dir=$(dirname $(realpath "$0"))
|
||||
|
||||
if $(file "$HOME/.zshrc"); then
|
||||
if $(file "$HOME/.zshrc" | grep -q "symbolic link") ; then
|
||||
if [[ $(readlink "$HOME/.zshrc") != "$current_dir/zshrc" ]]; then
|
||||
ln -sf "$current_dir/zshrc" "$HOME/.zshrc"
|
||||
fi
|
||||
else
|
||||
echo "Powerlevel10k is already exist. Updating..."
|
||||
git pull
|
||||
if [ ! -f "$HOME/.zshrc.bkp" ]; then
|
||||
mv "$HOME/.zshrc" "$HOME/.zshrc.bkp"
|
||||
ln -s "$current_dir/zshrc" "$HOME/.zshrc"
|
||||
else
|
||||
echo "Backup file already exists. Please remove $HOME/.zshrc.bkp and try again."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
ln -s "$current_dir/zshrc" "$HOME/.zshrc"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user