fix font prompt

This commit is contained in:
2026-04-03 15:24:09 +09:00
parent 24b072c539
commit 37177b0091
3 changed files with 19 additions and 10 deletions

View File

@@ -66,15 +66,24 @@ if [ ! -f "$HOME/.vim/autoload/plug.vim" ]; then
fi
# install font
fontpath="$HOME/.local/share/fonts/aifont.ttf"
fonturl="https://git.syui.ai/ai/font/raw/branch/main/aifont.ttf"
case "$(uname)" in
Darwin)
fontpath="$HOME/Library/Fonts/aifont.ttf"
;;
*)
fontpath="/usr/share/fonts/TTF/aifont.ttf"
;;
esac
if [ ! -f "$fontpath" ]; then
mkdir -p "$HOME/.local/share/fonts"
curl -sL -o "$fontpath" https://git.syui.ai/ai/font/raw/branch/main/aifont.ttf
echo "font: downloaded aifont.ttf"
fi
if [ "$(uname)" = "Darwin" ] && [ -f "$fontpath" ]; then
cp -f "$fontpath" ~/Library/Fonts/aifont.ttf
echo "font: aifont.ttf -> ~/Library/Fonts/"
mkdir -p "$(dirname "$fontpath")"
if [ "$(uname)" = "Darwin" ]; then
curl -sL -o "$fontpath" "$fonturl"
else
sudo curl -sL -o "$fontpath" "$fonturl"
fc-cache -f 2>/dev/null
fi
echo "font: $fontpath"
fi
echo "done"