fix font prompt
This commit is contained in:
@@ -23,7 +23,7 @@ get_cfg() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
has_aifont() {
|
has_aifont() {
|
||||||
[ -f "$HOME/Library/Fonts/aifont.ttf" ] || [ -f "$HOME/.local/share/fonts/aifont.ttf" ]
|
[ -f "$HOME/Library/Fonts/aifont.ttf" ] || [ -f "/usr/share/fonts/TTF/aifont.ttf" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
can_run() {
|
can_run() {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# requires: aifont (MesloLGS NF + ai/syui icons)
|
# requires: aifont (MesloLGS NF + ai/syui icons)
|
||||||
|
|
||||||
_has_aifont() {
|
_has_aifont() {
|
||||||
[[ -f "$HOME/Library/Fonts/aifont.ttf" ]] || [[ -f "$HOME/.local/share/fonts/aifont.ttf" ]]
|
[[ -f "$HOME/Library/Fonts/aifont.ttf" ]] || [[ -f "/usr/share/fonts/TTF/aifont.ttf" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
_powerline_git() {
|
_powerline_git() {
|
||||||
|
|||||||
23
install.zsh
23
install.zsh
@@ -66,15 +66,24 @@ if [ ! -f "$HOME/.vim/autoload/plug.vim" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# install font
|
# 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
|
if [ ! -f "$fontpath" ]; then
|
||||||
mkdir -p "$HOME/.local/share/fonts"
|
mkdir -p "$(dirname "$fontpath")"
|
||||||
curl -sL -o "$fontpath" https://git.syui.ai/ai/font/raw/branch/main/aifont.ttf
|
if [ "$(uname)" = "Darwin" ]; then
|
||||||
echo "font: downloaded aifont.ttf"
|
curl -sL -o "$fontpath" "$fonturl"
|
||||||
|
else
|
||||||
|
sudo curl -sL -o "$fontpath" "$fonturl"
|
||||||
|
fc-cache -f 2>/dev/null
|
||||||
fi
|
fi
|
||||||
if [ "$(uname)" = "Darwin" ] && [ -f "$fontpath" ]; then
|
echo "font: $fontpath"
|
||||||
cp -f "$fontpath" ~/Library/Fonts/aifont.ttf
|
|
||||||
echo "font: aifont.ttf -> ~/Library/Fonts/"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|||||||
Reference in New Issue
Block a user