Score:0

Is it possible to assign font styles and colors to Gedit and Gnome Terminal through the system's GTK theme?

ng flag

I have Gnome Tweaks installed on Ubuntu, and I was curious if it is possible to assign font colors and styles to Gedit and Terminal through the system theme to create a more unified look.

As I workaround, I was able to select Solarized in both apps, but the backgrounds didn't match the Arc-Dark theme. So in Gnome Terminal I had to customize the background and manually enter the hex code used for the Arc-Dark background. In Gedit I was able to save a copy of the Gedit Solarized .xml file in /.local/share/gedit/styles and slightly adjust the hex code to match Terminal.

The downside of the workaround is that if I change my system theme, I also have to go into each app and change the font colors. It would be nice if there was an option in both apps to use the system theme, but I was curious if anyone knew if that was even possible.

References:

cn flag
GNOME Terminal's Preferences -> Colors tab has an option "Use colros from system there", is this what you're looking for?
ng flag
That does help with setting the background to match the system theme, but it doesn't help with using a custom theme that isn't already preloaded in Gnome Terminal and having it match Gedit. I'm pretty sure that what I'm wanting to do can't be done out of the box, but I'm not sure if there's a way of doing it by hacking on something.
cn flag
I'm not familiar with gedit's syntax highlighting and similar definitions, but I'd guess it can work from an unlimited number of colors. The terminal, due to the legacy of all terminals, primarily uses a set of 2 (default fg + bg) + 16 (palette) colors. GNOME Terminals allows you to take the 2 values from global GTK settings, but the 16 palette colors are the terminal's own business, not shared by or taken from any other GNOME setting. You can programatically query and set them using `dconf` or `gsettings` under `/org/gnome/terminal/legacy`, see e.g. https://askubuntu.com/q/803230/398785.
ng flag
It might be a fun project to make a script that parses one of the gedit themes posted at gnome-look.org and automatically pull 16 hex codes along with the theme name and feed them to terminal using dconf or gsettings (depending on your version of Ubuntu) to make a matching profile. That's still kind of kludgy - Ideally a font color palette could be chosen in the system appearance settings, and it could be an option in any app whether to apply it.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.