install.fairie/home/.chezmoiscripts/run_onchange_after_add-fonts.tmpl
Brian Zalewski a2748ba201 Update 20 files
- /home/dot_config/nvim-custom/run_onchanges_after_symlink-custom.tmpl
- /home/dot_local/bin/run_onchange_ensure-executable.tmpl
- /home/dot_local/share/ansible/run_onchange_after_symlink-ansible-configs.tmpl
- /home/Library/Fonts/run_onchange_after_add-fonts.tmpl
- /home/private_dot_ssh/fail2ban/run_onchange_after_fail2ban.tmpl
- /home/private_dot_ssh/system/run_onchange_after_sshd.tmpl
- /home/private_dot_ssh/endlessh/run_onchange_after_endlessh.tmpl
- /home/private_dot_ssh/run_onchanges_after_decrypt-ssh-keys.tmpl
- /home/private_dot_ssh/run_onchanges_after_ensure-private-key.tmpl
- /home/private_dot_ssh/run_onchanges_after_generate-public-keys.tmpl
- /home/.chezmoiscripts/run_onchanges_after_symlink-custom.tmpl
- /home/.chezmoiscripts/run_onchange_ensure-executable.tmpl
- /home/.chezmoiscripts/run_onchange_after_symlink-ansible-configs.tmpl
- /home/.chezmoiscripts/run_onchange_after_add-fonts.tmpl
- /home/.chezmoiscripts/run_onchange_after_fail2ban.tmpl
- /home/.chezmoiscripts/run_onchange_after_sshd.tmpl
- /home/.chezmoiscripts/run_onchange_after_endlessh.tmpl
- /home/.chezmoiscripts/run_onchanges_after_decrypt-ssh-keys.tmpl
- /home/.chezmoiscripts/run_onchanges_after_ensure-private-key.tmpl
- /home/.chezmoiscripts/run_onchanges_after_generate-public-keys.tmpl
2023-04-15 22:16:15 +00:00

23 lines
878 B
Cheetah

{{- if eq .host.distro.family "darwin" -}}
#!/usr/bin/env bash
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
{{ $fontFiles := (output "find" (joinPath .chezmoi.homeDir ".local" "share" "fonts") "-type" "f") -}}
{{- range $fontFile := splitList "\n" $fontFiles -}}
{{- if ne $fontFile "" -}}
# {{ $fontFile }} hash: {{ $fontFile | sha256sum }}
{{ end -}}
{{- end }}
### Ensure all fonts are added to ~/Library/Fonts on macOS
find "$HOME/.local/share/fonts" -type f | while read FONT_FILE; do
BASENAME="$(basename "$FONT_FILE")"
if [ ! -f "$HOME/Library/Fonts/$BASENAME" ] || [ "$(openssl sha256 "$HOME/Library/Fonts/$BASENAME" | sed 's/.*= //')" != "$(openssl sha256 "$FONT_FILE" | sed 's/.*= //')" ]; then
logg info 'Adding '"$BASENAME"' to ~/Library/Fonts'
cp "$FONT_FILE" "$HOME/Library/Fonts/$BASENAME"
fi
done
{{ end -}}