fix font prompt
This commit is contained in:
@@ -23,7 +23,7 @@ get_cfg() {
|
||||
}
|
||||
|
||||
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() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# requires: aifont (MesloLGS NF + ai/syui icons)
|
||||
|
||||
_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() {
|
||||
|
||||
23
install.zsh
23
install.zsh
@@ -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"
|
||||
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
|
||||
if [ "$(uname)" = "Darwin" ] && [ -f "$fontpath" ]; then
|
||||
cp -f "$fontpath" ~/Library/Fonts/aifont.ttf
|
||||
echo "font: aifont.ttf -> ~/Library/Fonts/"
|
||||
echo "font: $fontpath"
|
||||
fi
|
||||
|
||||
echo "done"
|
||||
|
||||
Reference in New Issue
Block a user