install a nerd font
manual
Install this font:
JetBrainsMono
automated
This script will download and install 3 fonts (by saving them to a fonts dir
#!/usr/bin/env bash
function is_mac() {
local uname="$(uname -a)"
[[ "$uname_" =~ Darwin ]] && return
false
}
function git-repo-release(){
repo=${1? must provide a repo ex casonadams/walh }
version=$(curl \
-sSL "https://api.github.com/repos/${repo}/releases/latest" \
| grep '"tag_name":' \
| sed -E 's/.*"([^"]+)".*/\1/'\
)
echo $version
}
function install_fonts(){
local repo="ryanoasis/nerd-fonts"
local version=$(git-repo-release $repo)
local _dir="${HOME}/.local/share/fonts"
local url
if is_mac; then
_dir="${HOME}/Library/Fonts"
fi
mkdir -p $_dir
pushd $_dir
rm -rf "${_dir}/*"
# FONTS TO INSTALL
fonts=(
"FiraCode"
"JetBrainsMono"
"SourceCodePro"
)
for font in "${fonts[@]}"
do
url="https://github.com/${repo}/releases/download/${version}/${font}.tar.xz"
curl -sSL $url | tar -Jvx
done
popd
}
install_fonts
Setup alacritty
Grab this file alacritty.yml from github repo.
mkdir -p ~/.config/alacritty
curl -L https://github.com/alacritty/alacritty/blob/master/alacritty.yml -o ~/.config/alacritty/alacritty.yml
Then update the alacritty.yml file with the example below
vi ~/.config/alacritty/alacritty.yml
# Font configuration (changes require restart)
font:
# copy fonts to ~/.local/share/fonts (linux)
# copy fonts to ~/Library/Fonts (mac)
normal:
# family: "JetbrainsMono Nerd Font"
# family: "SauceCodePro Nerd Font"
family: "FiraCode Nerd Font"
size: 16