22 lines
693 B
Bash
22 lines
693 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Fedora / WSL Linux
|
|
if command -v dnf >/dev/null 2>&1; then
|
|
sudo dnf install -y fira-code-fonts
|
|
fc-cache -f
|
|
fi
|
|
|
|
# Windows user fonts (when running under WSL)
|
|
if [[ -d /mnt/c/Users ]]; then
|
|
win_fonts="/mnt/c/Users/${USER}/AppData/Local/Microsoft/Windows/Fonts"
|
|
if [[ ! -d "$win_fonts" ]]; then
|
|
win_fonts="/mnt/c/Users/${USER}/AppData/Local/Microsoft/Windows/Fonts"
|
|
fi
|
|
tmp=$(mktemp -d)
|
|
curl -sL "https://github.com/tonsky/FiraCode/releases/download/6.2/Fira_Code_v6.2.zip" -o "$tmp/FiraCode.zip"
|
|
unzip -q "$tmp/FiraCode.zip" -d "$tmp"
|
|
cp -f "$tmp/ttf/"*.ttf "$win_fonts/"
|
|
rm -rf "$tmp"
|
|
echo "Installed Fira Code to $win_fonts"
|
|
fi |