feat(dfm): install nerdfonts

This commit is contained in:
2023-09-24 23:46:09 +03:00
parent e0c6d7e4f4
commit f5b1bf0915
2 changed files with 50 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ function section_install
"cheat-databases:Install cheat external cheatsheet databases"
"composer:Install composer"
"dotenv:Install dotenv-linter"
"fonts:Install programming fonts"
"gh:Install GitHub CLI Extensions"
"go:Install Go Packages"
"imagick:Install ImageMagick CLI"
@@ -48,6 +49,7 @@ function section_install
case "$1" in
all)
$0 install macos
$0 install fonts
$0 install antigen
$0 brew install
$0 install pip
@@ -89,6 +91,10 @@ function section_install
| sh -s -- -b "$XDG_BIN_HOME" \
&& msg_yay "dotenv-linter installed!"
;;
fonts)
bash "$DOTFILES/scripts/install-fonts.sh" \
&& msg_yay "Installed fonts!"
;;
fzf)
bash "$DOTFILES/scripts/install-fzf.sh" \
&& msg_yay "fzf installed!"

44
scripts/install-fonts.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Install NerdFonts
#
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
GIT_REPO="https://github.com/ryanoasis/nerd-fonts.git"
TMP_PATH="$XDG_CACHE_HOME/nerd-fonts"
msg "-- NerdFonts --"
fonts=(
Hack
IntelOneMono
JetBrainsMono
OpenDyslexic
SpaceMono
)
if [ ! -d "$TMP_PATH" ]; then
git clone --filter=blob:none --sparse "$GIT_REPO" "$TMP_PATH"
fi
cd "$TMP_PATH" || {
msg_err "No such folder $TMP_PATH"
exit 1
}
for ext in "${fonts[@]}"; do
# Trim spaces
ext=${ext// /}
# Skip comments
if [[ ${ext:0:1} == "#" ]]; then continue; fi
msg_run "Adding $ext to sparse-checkout"
git sparse-checkout add "patched-fonts/$ext"
echo ""
done
msg "Starting to install NerdFonts..."
./install.sh -s ${fonts[*]}
msg_ok "Done"