mirror of
https://github.com/dnlbauer/dotfiles.git
synced 2026-09-10 21:45:30 +00:00
added fontconfig file
This commit is contained in:
51
run_onchange_before_25_fonts.sh
Executable file
51
run_onchange_before_25_fonts.sh
Executable file
@@ -0,0 +1,51 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
FONT_DIR="${HOME}/.local/share/fonts"
|
||||||
|
TEMP_DIR=$(mktemp -d)
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
rm -rf "$TEMP_DIR"
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
mkdir -p "$FONT_DIR"
|
||||||
|
|
||||||
|
echo "Installing fonts to ${FONT_DIR}..."
|
||||||
|
|
||||||
|
# Install Nerd Fonts
|
||||||
|
NERD_FONTS_VERSION="v3.4.0"
|
||||||
|
NERD_FONTS=(
|
||||||
|
"UbuntuMono"
|
||||||
|
"SourceCodePro"
|
||||||
|
"JetBrainsMono"
|
||||||
|
"AtkinsonHyperlegibleMono"
|
||||||
|
)
|
||||||
|
|
||||||
|
for font in "${NERD_FONTS[@]}"; do
|
||||||
|
echo "Downloading ${font} Nerd Font..."
|
||||||
|
curl -fsSL "https://github.com/ryanoasis/nerd-fonts/releases/download/${NERD_FONTS_VERSION}/${font}.zip" -o "${TEMP_DIR}/${font}.zip"
|
||||||
|
|
||||||
|
unzip -q "${TEMP_DIR}/${font}.zip" -d "${TEMP_DIR}/${font}"
|
||||||
|
|
||||||
|
# Copy only TTF and OTF files, excluding Windows-compatible versions
|
||||||
|
find "${TEMP_DIR}/${font}" -type f \( -name "*.ttf" -o -name "*.otf" \) ! -name "*Windows Compatible*" -exec cp {} "${FONT_DIR}/" \;
|
||||||
|
|
||||||
|
echo "Installed ${font} Nerd Font"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Install Charis SIL
|
||||||
|
echo "Downloading Charis SIL..."
|
||||||
|
CHARIS_VERSION="6.200"
|
||||||
|
curl -fsSL "https://software.sil.org/downloads/r/charis/CharisSIL-${CHARIS_VERSION}.zip" -o "${TEMP_DIR}/CharisSIL.zip"
|
||||||
|
|
||||||
|
unzip -q "${TEMP_DIR}/CharisSIL.zip" -d "${TEMP_DIR}/charis"
|
||||||
|
find "${TEMP_DIR}/charis" -type f \( -name "*.ttf" -o -name "*.otf" \) -exec cp {} "${FONT_DIR}/" \;
|
||||||
|
|
||||||
|
echo "Installed Charis SIL"
|
||||||
|
|
||||||
|
# Update font cache
|
||||||
|
echo "Updating font cache..."
|
||||||
|
fc-cache -f "$FONT_DIR"
|
||||||
|
echo "Done"
|
||||||
|
|
||||||
Reference in New Issue
Block a user