nerd-fonts misc

This commit is contained in:
2026-03-29 00:14:29 +08:00
parent 721b69b3f9
commit 7112296339

View File

@@ -5,13 +5,8 @@ set -eo pipefail
#TODO nokia-sans
isMac() {
uname -s | grep -q "Darwin"
}
isLinux() {
uname -s | grep -q "Linux"
}
isMac() { uname -s | grep -q "Darwin"; }
isLinux() { uname -s | grep -q "Linux"; }
url="https://github.com/ryanoasis/nerd-fonts/releases/latest/download"
downloadPath="$HOME/install/nerd-fonts"
@@ -20,20 +15,20 @@ if isMac; then
elif isLinux; then
installPath="$HOME/.local/share/fonts/"
else
echo "Ths OS not supported yet!"
echo "This OS is not supported yet!"
exit
fi
fontsNames=(
FiraCode
FiraMono
# FiraMono
JetBrainsMono
Meslo
# Noto
RobotoMono
Ubuntu
UbuntuMono
UbuntuSans
# Ubuntu
# UbuntuMono
# UbuntuSans
)
install() {
@@ -44,17 +39,13 @@ install() {
echo
[[ -d "$downloadPath" ]] || mkdir -p "$downloadPath"
for fontname in "${fontsNames[@]}"; do
fontDir="$installPath/Nerd-$fontname"
wget "$url/$fontname.tar.xz" -O "$downloadPath/$fontname.tar.xz"
[[ -d "$installPath/$fontname" ]] || mkdir -p "$fontDir"
tar -xJf "$downloadPath/$fontname.tar.xz" -C "$fontDir"
done
if isLinux; then
fc-cache -vf "$installPath"
fi
isLinux && fc-cache -vf "$installPath"
echo
echo "Finish!"
@@ -69,10 +60,7 @@ remove() {
echo
find "$installPath" -type d -name "Nerd-*" -exec rm -rf {} +
if isLinux; then
fc-cache -vf "$installPath"
fi
isLinux && fc-cache -vf "$installPath"
echo
echo "Finish!"