Skip to content

Instantly share code, notes, and snippets.

@pedrominicz
Created August 12, 2022 13:28
Show Gist options
  • Save pedrominicz/e88956480f18d34503de6bc58948923f to your computer and use it in GitHub Desktop.
Save pedrominicz/e88956480f18d34503de6bc58948923f to your computer and use it in GitHub Desktop.
Gnome terminal config with fallback fonts

How to use this config

Because the people behind Gnome are geniuses, they decided to the end the long tradition of having config files somewhere in $HOME/.config and instead store settings in "some binary file optimized for quick reading" that is located "somewhere".

Thanks, loading small plain text config files was terrible a bottleneck. I am glad the dozen custom settings I have can now load blazingly fast. Parsing simple plain text config files is a very computationally intensive process. Also, I am so glad I have no idea where this binary file is located, I always felt anxious knowing my config files where ominously sitting somewhere in $HOME/.config, watching my every move.

Sarcasm aside, there is a way of interacting with said binary file as if it where a plain text config file using dconf dump and dconf load.

$ dconf load /org/gnome/terminal/ <<EOF
> [legacy]
> new-terminal-mode='window'
> theme-variant='dark'
> 
> [legacy/profiles:/:$UUID]
> audible-bell=false
> background-color='rgb(255,255,255)'
> font='Source Code Pro Medium, DejaVu Sans Mono 13'
> foreground-color='rgb(23,20,33)'
> scrollback-unlimited=true
> scrollbar-policy='never'
> use-system-font=false
> use-theme-colors=true
> EOF

Note the use of $UUID, set it to be the UUID of your Gnome Terminal profile. Be careful, this command can overwrite some of your current settings.

Why do it this way? Every setting shown above can be directly configured inside Gnome Terminal... except the font setting. Gnome Terminal doesn't allow you to set fallback fonts. Doing it this way, I can set my primary font to be Source Code Pro with DejaVu Sans Mono as a fallback. In practice, I configure things normally then run:

$ dconf load /org/gnome/terminal/ <<EOF
> [legacy/profiles:/:$UUID]
> font='Source Code Pro Medium, DejaVu Sans Mono 13'
> EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment