2023-01-28 22:07:01 -08:00
|
|
|
{{- if (eq .host.distro.family "linux") -}}
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
{{ includeTemplate "universal/profile" }}
|
|
|
|
{{ includeTemplate "universal/logg" }}
|
|
|
|
|
2023-01-28 22:55:46 -08:00
|
|
|
# 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
|
2023-01-28 22:07:01 -08:00
|
|
|
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 -}}
|