nerd-fonts for mac
This commit is contained in:
@@ -5,16 +5,31 @@ set -eo pipefail
|
||||
|
||||
#TODO nokia-sans
|
||||
|
||||
downloadPath="$HOME/install/nerd-fonts"
|
||||
installPath="$HOME/.local/share/fonts/"
|
||||
url="https://github.com/ryanoasis/nerd-fonts/releases/latest/download"
|
||||
isMac() {
|
||||
uname -s | grep -q "Darwin"
|
||||
}
|
||||
|
||||
fonts=(
|
||||
isLinux() {
|
||||
uname -s | grep -q "Linux"
|
||||
}
|
||||
|
||||
url="https://github.com/ryanoasis/nerd-fonts/releases/latest/download"
|
||||
downloadPath="$HOME/install/nerd-fonts"
|
||||
if isMac; then
|
||||
installPath="$HOME/Library/Fonts/"
|
||||
elif isLinux; then
|
||||
installPath="$HOME/.local/share/fonts/"
|
||||
else
|
||||
echo "Ths OS not supported yet!"
|
||||
exit
|
||||
fi
|
||||
|
||||
fontsNames=(
|
||||
FiraCode
|
||||
FiraMono
|
||||
JetBrainsMono
|
||||
Meslo
|
||||
Noto
|
||||
# Noto
|
||||
RobotoMono
|
||||
Ubuntu
|
||||
UbuntuMono
|
||||
@@ -30,14 +45,16 @@ install() {
|
||||
|
||||
[[ -d "$downloadPath" ]] || mkdir -p "$downloadPath"
|
||||
|
||||
for fontname in "${fonts[@]}"; do
|
||||
fontdir="$installPath/Nerd-$fontname"
|
||||
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"
|
||||
[[ -d "$installPath/$fontname" ]] || mkdir -p "$fontDir"
|
||||
tar -xJf "$downloadPath/$fontname.tar.xz" -C "$fontDir"
|
||||
done
|
||||
|
||||
if isLinux; then
|
||||
fc-cache -vf "$installPath"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Finish!"
|
||||
@@ -52,7 +69,10 @@ remove() {
|
||||
echo
|
||||
|
||||
find "$installPath" -type d -name "Nerd-*" -exec rm -rf {} +
|
||||
|
||||
if isLinux; then
|
||||
fc-cache -vf "$installPath"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Finish!"
|
||||
|
||||
Reference in New Issue
Block a user