twpayne / chezmoi

Manage your dotfiles across multiple diverse machines, securely.
https://www.chezmoi.io/
MIT License
13.27k stars 493 forks source link

How would I ideally ship fonts with chezmoi? #2625

Closed KasperSkytte closed 1 year ago

KasperSkytte commented 1 year ago

Some prompts and shell enhancements like starship and oh-my-zsh require special fonts to display in the terminal correctly. I'd like to ship these in a convenient way with the dotfiles, in my case into ~/.local/share/fonts on Linux. What's the most ideal way to do that with chezmoi?

KasperSkytte commented 1 year ago

My github issues search doesn't work at the moment for some reason, so my apologies if this is a duplicate

twpayne commented 1 year ago
  • Define external archives/git repo subfolders in .chezmoiexternal (would be a whole folder with .tff files to copy from, but the fonts must be individual files in ~/.local/share/fonts)?

This is the approach I recommend and I use. You can see how I manage fonts in my own dotfiles here. Note that the red syntax highlighting comes from the mix of Go template and TOML syntax.

KasperSkytte commented 1 year ago

Alright, thank you! I'm using both Meslo and Fira Code fonts, Fira has so many files. I guess I'll just pick them out individually

bradenhilton commented 1 year ago

If your package manager has the fonts, you can also install them with a run_once_before_ script which invokes your package manager.