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