From e5b6ab8d2eecfbf3edf40f5c8e831e2abff64c69 Mon Sep 17 00:00:00 2001 From: Raul Benencia Date: Fri, 1 Nov 2024 16:57:16 -0700 Subject: fonts: automate installation --- Makefile | 3 +++ bin/setup-install-fonts | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 bin/setup-install-fonts diff --git a/Makefile b/Makefile index f77b891..0aa85f9 100644 --- a/Makefile +++ b/Makefile @@ -8,3 +8,6 @@ bin_file_name := 10-$(cur_dir) all: $(bin_dir)/pycombine -e '(Makefile|README.md|debian)' "$(HOME)" "$(repo_dir)" xdg-settings set default-url-scheme-handler org-protocol org-protocol.desktop + +fonts: + $(bin_dir)/setup-install-fonts diff --git a/bin/setup-install-fonts b/bin/setup-install-fonts new file mode 100755 index 0000000..ea96873 --- /dev/null +++ b/bin/setup-install-fonts @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +FONT_DIR="$HOME/.local/share/fonts" +TEMP_DIR=$(mktemp -d) + +mkdir -p "$FONT_DIR" + +pushd $TEMP_DIR +curl -s 'https://api.github.com/repos/be5invis/Iosevka/releases/latest' | \ + jq -r ".assets[] | .browser_download_url" | \ + grep PkgTTC-Iosevka | \ + xargs -n 1 curl -L -O --fail --silent --show-error + +for f in *.zip; do + unzip "$f" +done + +mv *.ttc "$FONT_DIR/" +fc-cache -f -v "$FONT_DIR" + +popd +rm -rf "$TEMP_DIR" + +echo "Iosevka fonts have been installed." -- cgit v1.2.3