individual zsh configuration

This commit is contained in:
2025-04-27 22:00:40 +08:00
parent 7b38c2669f
commit d264d3061c
11 changed files with 106 additions and 1961 deletions

View File

@@ -1,5 +1,22 @@
#! /bin/bash
current_dir=$(dirname "$0")
current_dir=$(dirname $(realpath "$0"))
starship_config_file="$HOME/.config/starship.toml"
cp "$current_dir/../starship/starship.toml" "$HOME/.config/"
if [[ $(file $starship_config_file) ]]; then
if $(file "$starship_config_file" | grep -q "symbolic link") ; then
if [[ $(readlink "$starship_config_file") != $(realpath "$current_dir/../starship/starship.toml") ]]; then
ln -sf "$current_dir/../starship/starship.toml" "$starship_config_file"
fi
else
if [ ! -f "$starship_config_file.bkp" ]; then
mv "$starship_config_file" "$starship_config_file.bkp"
ln -s "$current_dir/../starship/starship.toml" "$starship_config_file"
else
echo "Backup file already exists. Please remove $starship_config_file.bkp and try again."
exit 1
fi
fi
else
ln -sf "$current_dir/../starship/starship.toml" "$starship_config_file"
fi