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