This script allows you to download and install Nerd Fonts with ease, either by specifying the font name(s) as command-line arguments or by selecting from a provided list if no arguments are given.
Ensure that curl
or wget
, tar
, and fc-cache
(from fontconfig
) are installed on your system.
sudo apt update
sudo apt install curl wget tar fontconfig
sudo dnf install curl wget tar fontconfig
You can directly download one or multiple fonts by specifying their name(s) as command-line arguments.
Example:
bash -c "$(curl -fsSL https://gist.github.com/yashodhank/1a9d94115f087dd59fba39dfc634dde6/raw/nerd-font-installer.sh)" -- FontName1 FontName2 ... FontNameN
Real Example to install NerdFontsSymbolsOnly, Terminus, SourceCodePro, FiraCode and Hack Fonts using CLI ARGs method:
bash -c "$(curl -fsSL https://gist.github.com/yashodhank/1a9d94115f087dd59fba39dfc634dde6/raw/nerd-font-installer.sh)" -- Hack FiraCode SourceCodePro Terminus NerdFontsSymbolsOnly
Ensure that the specified font name(s) match with the actual names used in the download URLs on the Nerd Fonts GitHub releases page.
If you do not provide any command-line arguments, the script will present you with a list of available fonts to choose from.
Example:
bash -c "$(curl -fsSL https://gist.github.com/yashodhank/1a9d94115f087dd59fba39dfc634dde6/raw/nerd-font-installer.sh)"
Follow the interactive prompts to select and download a font.
- Run the Script: Use one of the usage methods described above to run the script and download Nerd Fonts.
-
Command Not Found Error: If you encounter a "command not found" error, ensure that the script is made executable and that you are in the correct directory.
-
Download Failures: If a font fails to download, double-check the spelling of the font name and ensure it matches the name used in the Nerd Fonts GitHub releases page.
-
Permission Denied: If you encounter a "permission denied" error, ensure you have write access to the installation directory (
~/.fonts/
by default). You may need to adjust your directory permissions.
This script is provided with no warranty. Ensure to review and test in a safe environment before using it in a critical system.