Ubuntu – How to change the background to use built-in theme from gnome-terminal profile preferences –> Color using dconf or gsettings

18.04command linegnome-terminalxml

For gnome-terminal –> Edit –> Preference –> profile –> color, I don't want to "use color from system theme" but use "built-in schemes = Solarized dark".

According to this answer, I am able to use these commands to get the UUID of the profile I want to change:

gsettings get org.gnome.Terminal.ProfilesList list
gsettings get org.gnome.Terminal.ProfilesList default

Also I can see the UUID of the profile at the bottom right corner of gnome-terminal –> Edit –> Preference –> profile –> color.

To deselect "use color from system theme", I used this command:

gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:UUID/ use-theme-colors false 

How do I then use the given "built-in schemes", e.g. "Solarized dark", "Tango dark" via cmdline? I could not find their name in /usr/share/glib-2.0/schemas/org.gnome.Terminal.gschema.xml

Best Answer

There are no schemas designed for "Built-in-schemes:"

what is "Built-in-schemes:" doing is, it has pre-configured colors..

for the foreground-color with description "Default color of text in terminal"

for the background-color with description "Default color of terminal background"

So find out the two colors (first choose the Buili-in-schems) for the "Built-in-schems:" with the below commands

note: change the UUID in below commands with your UUID

pratap@pratap:~$ gsettings get org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:dec6f19d-ac6e-438a-8a48-122429c5c909/ foreground-color
pratap@pratap:~$ gsettings get org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:dec6f19d-ac6e-438a-8a48-122429c5c909/ background-color

This means when ever you provide these two rgb colors.. the "Built-in-schemes:" will be changed to "Solarized-dark"

For Example: If you want to have "Tango-Dark" as the "Built-in-schemes:"

Run the below commands.. Change the UUID with your profile ID.

gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:dec6f19d-ac6e-438a-8a48-122429c5c909/ foreground-color 'rgb(211,215,207)'

gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:dec6f19d-ac6e-438a-8a48-122429c5c909/ background-color 'rgb(46,52,54)'

In the below GIF, I have two terminals open. The left one is the profile with ID starting with "dec6" and the commands I gave in other Terminal with different profile..

enter image description here