Skip to content

Instantly share code, notes, and snippets.

@rabin-io
Last active October 29, 2023 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rabin-io/28a701ced8127ced0e39b23188f8f712 to your computer and use it in GitHub Desktop.
Save rabin-io/28a701ced8127ced0e39b23188f8f712 to your computer and use it in GitHub Desktop.
Install All The Nerd Fonts

Create a tmp folder and download the nerds-fonts-downloader.sh script into it, chmod it and run it.

I assume you have parallel installed, if not, install it first.

mkdir /tmp/fonts && cd /tmp/fonts
wget https://gist.githubusercontent.com/rabin-io/28a701ced8127ced0e39b23188f8f712/raw/nerds-fonts-downloader.sh
chmod +x nerds-fonts-downloader.sh
./nerds-fonts-downloader.sh

Now you should have a folder named patched-fonts which all the fonts extracted to it. Download the install.sh script from the git repo, chmod it and run it as root to install the fonts globally for the system.

curl -sL https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/install.sh | sudo bash -s -- --clean --install-to-system-path
#!/bin/bash
function download_fonts() {
curl -s https://api.github.com/repos/ryanoasis/nerd-fonts/releases \
| jq -r '.[0].assets[] | select(.browser_download_url | endswith(".zip")) | .browser_download_url' \
| parallel --bar -t -- curl -sLOC - {}
}
function download_install_script() {
rm -f install.sh
curl -OL https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/install.sh
chmod +x install.sh
}
function remove_old_stuff() {
rm -rf patched-fonts && mkdir -p patched-fonts
}
download_fonts
download_install_script
remove_old_stuff
ls -1b | parallel -- unzip -o {} \*.\[ot\]tf -d patched-fonts/{.}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment