mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
feat(dfm): install nerdfonts
This commit is contained in:
@@ -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
44
scripts/install-fonts.sh
Executable 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"
|
||||
Reference in New Issue
Block a user