Created
March 31, 2025 11:34
-
-
Save vyorkin/87717f905aa67518d9cb3ed6060e22d6 to your computer and use it in GitHub Desktop.
Install nerd fonts on linux (Ubuntu)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
fonts_dir="$HOME/.local/share/fonts" | |
if [[ ! -d "$fonts_dir" ]]; then | |
mkdir -p "$fonts_dir" | |
fi | |
for font in "$@"; do | |
zip_file="$font.zip" | |
download_url="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$zip_file" | |
echo "Downloading $download_url" | |
wget -O "/tmp/$zip_file" "$download_url" | |
unzip "/tmp/$zip_file" -d "/tmp/$font/" | |
mv /tmp/$font/*.ttf $fonts_dir | |
rm "/tmp/$zip_file" | |
rm "/tmp/$font/" -rf | |
done | |
fc-cache -fv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment