2f9a236021
- /home/.chezmoiscripts/run_onchange_after_add-fonts.tmpl - /home/.chezmoiscripts/run_onchange_after_endlessh.tmpl - /home/.chezmoiscripts/run_onchange_after_fail2ban.tmpl - /home/.chezmoiscripts/run_onchange_after_symlink-ansible-configs.tmpl - /home/.chezmoiscripts/run_onchange_after_sshd.tmpl - /home/.chezmoiscripts/run_onchanges_after_decrypt-ssh-keys.tmpl - /home/.chezmoiscripts/run_onchange_ensure-executable.tmpl - /home/.chezmoiscripts/run_onchanges_after_ensure-private-key.tmpl - /home/.chezmoiscripts/run_onchanges_after_generate-public-keys.tmpl - /home/.chezmoiscripts/run_onchanges_after_symlink-custom.tmpl - /home/.chezmoitemplates/ssh/authorized-keys.yubikey - /home/.chezmoiscripts/universal/run_onchange_after_24-vpn-darwin.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_20-font.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_02-ensure-executable.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_05-decrypt-ssh-keys.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_07-ensure-private-key.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_08-generate-public-keys.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_08-symlink-custom.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_24-vpn-darwin.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_30-endlessh.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_30-sshd.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_31-fail2ban.sh.tmpl - /home/.chezmoiscripts/disabled/run_onchange_after_symlink-ansible-configs.tmpl - /home/.chezmoiscripts/linux/run_onchange_before_01-requirements.sh.tmpl - /home/.chezmoiscripts/linux/run_onchange_before_10-system-tweaks.sh.tmpl - /home/.chezmoiscripts/linux/run_onchange_before_11-configure-swap.sh.tmpl - /home/.chezmoiscripts/linux/run_onchange_before_14-warp.sh.tmpl - /home/.chezmoitemplates/ssh/encrypted_authorized-keys.yubikey.tmpl
35 lines
1.4 KiB
Cheetah
35 lines
1.4 KiB
Cheetah
{{- if (eq .host.distro.family "linux") -}}
|
|
#!/usr/bin/env bash
|
|
# @file Linux Fonts
|
|
# @brief Ensures fonts are available at the system level and, on Linux, it configures the system font settings.
|
|
# @description
|
|
# This script is utilized to ensure the same fonts are consistently used across the system.
|
|
|
|
{{ includeTemplate "universal/profile" }}
|
|
{{ includeTemplate "universal/logg" }}
|
|
|
|
# font config hash: {{ include (joinPath .host.home ".config" "fontconfig" "fonts.conf") | sha256sum }}
|
|
|
|
### Sync user fonts with system fonts
|
|
if [ -d /Applications ] && [ -d /System ]; then
|
|
# macOS
|
|
logg info 'Copying fonts from ~/Library/Fonts and ~/.local/share/fonts to /Library/Fonts to make them available globally'
|
|
FONT_DIR='/Library/Fonts'
|
|
sudo rsync -av "$HOME/Library/Fonts" "$FONT_DIR"
|
|
sudo rsync -av "$HOME/.local/share/fonts" "$FONT_DIR"
|
|
else
|
|
# Linux
|
|
logg info 'Copying fonts from ~/.local/share/fonts to /usr/local/share/fonts to make them available globally'
|
|
FONT_DIR='/usr/local/share/fonts'
|
|
sudo rsync -av "$HOME/.local/share/fonts" "$FONT_DIR"
|
|
fi
|
|
|
|
### Configure system font properties
|
|
if [ -d /etc/fonts ]; then
|
|
logg info 'Copying ~/.config/fontconfig/fonts.conf to /etc/fonts/local.conf'
|
|
sudo cp -f "${XDG_CONFIG_HOME:-$HOME/.config}/fontconfig/fonts.conf" /etc/fonts/local.conf
|
|
else
|
|
logg warn 'The `/etc/fonts` directory is missing'
|
|
fi
|
|
|
|
{{ end -}}
|