-
Notifications
You must be signed in to change notification settings - Fork 0
/
10_install_lunarvim_nerd_font.sh
executable file
·30 lines (24 loc) · 1.24 KB
/
10_install_lunarvim_nerd_font.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Create the local fonts directory
FONT_DIR="$HOME/.local/share/fonts"
mkdir -p "$FONT_DIR"
# Array of fonts to install (you can add more as needed)
declare -A FONTS
FONTS["DroidSansMono"]="https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/DroidSansMono/DroidSansMNerdFont-Regular.otf"
FONTS["FiraCode"]="https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/FiraCode/Regular/FiraCodeNerdFont-Regular.otf"
FONTS["JetBrainsMono"]="https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/JetBrainsMono/Regular/JetBrainsMonoNerdFont-Regular.otf"
FONTS["Hack"]="https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/Hack/Regular/HackNerdFont-Regular.otf"
FONTS["MesloLGS"]="https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/Meslo/L/Regular/MesloLGSNerdFont-Regular.otf"
# Download and install each font
for font in "${!FONTS[@]}"; do
echo "Downloading $font Nerd Font..."
curl -fLo "$FONT_DIR/${font}NerdFont-Regular.otf" "${FONTS[$font]}"
done
# Refresh the font cache (Linux specific)
if command -v fc-cache >/dev/null 2>&1; then
echo "Refreshing font cache..."
fc-cache -fv
else
echo "Font cache not found, please refresh manually."
fi
echo "Nerd Fonts installation complete!"