Skip to content

Instantly share code, notes, and snippets.

@lvaylet
Last active May 9, 2023 20:06
Show Gist options
  • Save lvaylet/77b917e8c9cfc65b453ca950c02e88c0 to your computer and use it in GitHub Desktop.
Save lvaylet/77b917e8c9cfc65b453ca950c02e88c0 to your computer and use it in GitHub Desktop.
Install fonts for Distrotube's config

00 - Fonts

Create local fonts folder. Note that ~/.fonts is deprecated.

mkdir -p ~/.local/share/fonts

Download each font individually with:

cd ~/.local/share/fonts

# Mononoki
curl -fLo "Mononoki Regular Nerd Font Complete.ttf"          https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Mononoki/Regular/complete/mononoki-Regular%20Nerd%20Font%20Complete.ttf?raw=true
curl -fLo "Mononoki Regular Nerd Font Complete Mono.ttf"     https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Mononoki/Regular/complete/mononoki-Regular%20Nerd%20Font%20Complete%20Mono.ttf?raw=true
curl -fLo "Mononoki Bold Nerd Font Complete.ttf"             https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Mononoki/Bold/complete/mononoki%20Bold%20Nerd%20Font%20Complete.ttf?raw=true
curl -fLo "Mononoki Bold Nerd Font Complete Mono.ttf"        https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Mononoki/Bold/complete/mononoki%20Bold%20Nerd%20Font%20Complete%20Mono.ttf?raw=true
curl -fLo "Mononoki Italic Nerd Font Complete.ttf"           https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Mononoki/Italic/complete/mononoki%20Italic%20Nerd%20Font%20Complete.ttf?raw=true
curl -fLo "Mononoki Italic Nerd Font Complete Mono.ttf"      https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Mononoki/Italic/complete/mononoki%20Italic%20Nerd%20Font%20Complete%20Mono.ttf?raw=true
curl -fLo "Mononoki Bold Italic Nerd Font Complete.ttf"      https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Mononoki/Bold-Italic/complete/mononoki%20Bold%20Italic%20Nerd%20Font%20Complete.ttf?raw=true
curl -fLo "Mononoki Bold Italic Nerd Font Complete Mono.ttf" https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Mononoki/Bold-Italic/complete/mononoki%20Bold%20Italic%20Nerd%20Font%20Complete%20Mono.ttf?raw=true

# Sauce Code Pro
curl -fLo "Sauce Code Pro Regular Nerd Font Complete.ttf"          https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/SourceCodePro/Regular/complete/Sauce%20Code%20Pro%20Nerd%20Font%20Complete.ttf?raw=true
curl -fLo "Sauce Code Pro Regular Nerd Font Complete Mono.ttf"     https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/SourceCodePro/Regular/complete/Sauce%20Code%20Pro%20Nerd%20Font%20Complete%20Mono.ttf?raw=true
curl -fLo "Sauce Code Pro Bold Nerd Font Complete.ttf"             https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/SourceCodePro/Bold/complete/Sauce%20Code%20Pro%20Bold%20Nerd%20Font%20Complete.ttf?raw=true
curl -fLo "Sauce Code Pro Bold Nerd Font Complete Mono.ttf"        https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/SourceCodePro/Bold/complete/Sauce%20Code%20Pro%20Bold%20Nerd%20Font%20Complete%20Mono.ttf?raw=true
curl -fLo "Sauce Code Pro Italic Nerd Font Complete.ttf"           https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/SourceCodePro/Italic/complete/Sauce%20Code%20Pro%20Italic%20Nerd%20Font%20Complete.ttf?raw=true
curl -fLo "Sauce Code Pro Italic Nerd Font Complete Mono.ttf"      https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/SourceCodePro/Italic/complete/Sauce%20Code%20Pro%20Italic%20Nerd%20Font%20Complete%20Mono.ttf?raw=true
curl -fLo "Sauce Code Pro Bold Italic Nerd Font Complete.ttf"      https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/SourceCodePro/Bold-Italic/complete/Sauce%20Code%20Pro%20Bold%20Italic%20Nerd%20Font%20Complete.ttf?raw=true
curl -fLo "Sauce Code Pro Bold Italic Nerd Font Complete Mono.ttf" https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/SourceCodePro/Bold-Italic/complete/Sauce%20Code%20Pro%20Bold%20Italic%20Nerd%20Font%20Complete%20Mono.ttf?raw=true

Alternatively, you can (shallow) clone https://github.com/ryanoasis/nerd-fonts in a temporary directory (1.06 GiB!!) and use the install script to automate the installation of entire font families.

cd /tmp
git clone --depth 1 https://github.com/ryanoasis/nerd-fonts.git
cd nerd-fonts
./install.sh Mononoki
./install.sh SourceCodePro
#./install.sh Meslo
#...
cd ..
rm -rf nerd-fonts/

For Source Code Pro, download a zip file from Adobe's GitHub and unzip it with:

cd /tmp
curl -fLo source-code-pro.zip https://github.com/adobe-fonts/source-code-pro/releases/download/2.038R-ro%2F1.058R-it%2F1.018R-VAR/TTF-source-code-pro-2.038R-ro-1.058R-it.zip
unzip source-code-pro.zip -d ~/.local/share/fonts/
rm source-code-pro.zip

For Font Awesome 5, download a zip file from Font Awesome's website and unzip it with:

cd /tmp
curl -fLo font-awesome-5.zip https://use.fontawesome.com/releases/v5.15.3/fontawesome-free-5.15.3-desktop.zip
unzip font-awesome-5.zip -d ~/.local/share/fonts/
rm font-awesome-5.zip

Finally, update the font cache with:

fc-cache --force --verbose

And confirm the fonts are installed with:

fc-list | grep -i mononoki | wc -l          # should return 8
fc-list | grep -i sauce | wc -l             # should return 8
fc-list | grep -i source | wc -l            # should return 14
fc-list | grep -i "Font Awesome 5" | wc -l  # should return 3

List all the fonts installed with:

fc-list : family style | sort | uniq

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment