4

As the title asks, I'm wondering if it's possible to change an application's understanding of which fonts are used for the Interface Text and Document Text values in Gnome.

Context:

I generally use TablePlus when working with SQL Server, PostgreSQL, and MySQL databases. It's a closed-source application, which means I do not have the luxury of reaching into the code and changing the fonts that are used within the application.

Because it is a SQL editor, monospaced fonts are the only realistic option to use. An l must look like an l and not a 1. I can get the application to use monospaced fonts in the interface if I change the Interface Text and Document Text values in GNOME Tweaks, but I do not want to make everything on Ubuntu monospaced, as that's overkill (besides, I like the Ubuntu font).

On the left is what I have, and on the right is what I want to see (in the editor and results spaces only, but one battle at a time):

Table Plus Minus the Preferences

So, if the application is reading the Interface Text and Document Text values from the GNOME interface settings, I would like to have the application use a font of my choosing. There is an outstanding issue requesting the ability to change the font settings within the application already, but it has not been implemented.

6
  • 2
    Can you trick it into thinking your home directory is elsewhere by running it as HOME=/some/other/directory tableplus (or whatever the actual command is)?
    – muru
    May 26, 2021 at 7:40
  • @muru looks like I can do that, yes. The application will recreate its local cache files in the directory I specify and load. Would it be possible to have a copy of the Gnome font settings in that faux directory with the monospaced fonts?
    – matigo
    May 26, 2021 at 7:51
  • I think so. Your original file would be in ~/.config/dconf. You can make the change in Tweaks, then copy it to the fake home and then change back in Tweaks.
    – muru
    May 26, 2021 at 8:18
  • @muru well, I'll be a son of a gun. This works! ありがとうございました! 🙇🏻‍♂️
    – matigo
    May 26, 2021 at 8:26
  • Out of curiosity, can you check if just setting XDG_CONFIG_HOME (instead of HOME) is enough?
    – muru
    May 26, 2021 at 8:28

1 Answer 1

1

One possible solution is to make it look for the configuration in a different location than the usual place.

With a reasonably well-behaved modern tool, configuration should be in $XDG_CONFIG_HOME (defaults to $HOME/.config), so setting XDG_CONFIG_HOME to some other directory and keeping a copy of your desired configuration there should work (this should be true of GNOME Tweaks itself). However, not everything supports the XDG specification yet, and especially in the case of proprietary applications, you might need to be more blunt and set HOME instead. (Particularly bad applications may even try to get HOME from NSS, and ignore the HOME environment variable.)

The GSettings/DConf configuration is stored in $XDG_CONFIG_HOME/dconf (~/.config/dconf by default). You can change the font, then copy that directory somewhere else, and run the offending application with XDG_CONFIG_HOME (or HOME, if it's not well-behaved) set to point there.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .