5

In Ubuntu 17.04 the gnome-terminal uses 'colors from system theme'

enter image description here

I am looking for a bash/script way to modify this, I'd like to have gnome-terminal use the Solarized Theme. That means, uncheck the 'use colors from system them' and pick Solarized Dark from the build-in schemes.

enter image description here

I'm able to list out the possible keys that can be get/set:

UUID=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
gsettings list-keys org.gnome.Terminal.Legacy.Profile:/$UUID/

And here's the list I get, but I can't figure out which one of these to set to get Solarized Dark.

audible-bell
cursor-shape
scroll-on-keystroke
cursor-colors-set
cjk-utf8-ambiguous-width
default-size-rows
encoding
use-theme-colors
custom-command
visible-name
login-shell
exit-action
use-system-font
rewrap-on-resize
backspace-binding
foreground-color
bold-color-same-as-fg
background-transparency-percent
cursor-blink-mode
default-show-menubar
default-size-columns
background-color
palette
cursor-foreground-color
allow-bold
use-theme-transparency
highlight-foreground-color
font
delete-binding
scrollback-unlimited
use-transparent-background
cursor-background-color
highlight-background-color
scroll-on-output
scrollbar-policy
use-custom-command
bold-color
highlight-colors-set
scrollback-lines
word-char-exceptions

I tried setting this to true/false, but it has made no difference

gsettings set org.gnome.Terminal.Legacy.Profile:/$UUID/ use-theme-colors false
1
  • I'm not sure what's going on here, but deleting the default profile with dconf reset -f /org/gnome/terminal/legacy/profiles:/ and then opening GNOME Terminal caused the profile to be recreated, and this time use-theme-colors actually had an effect. (Changing the scheme after that changed the background-color and foreground-color keys.)
    – muru
    Sep 19 '17 at 8:28
2

Also I can't find that something like Solarized Dark in gsettings or dconf.

Method1:

But according to this answer, we can find Solarized Dark RGB parameters, and set gnome-terminal colors to that parameters.

You can do this with dconf-cli:

sudo apt install dconf-cli

And then find your profile id with this command:

dconf list /org/gnome/terminal/legacy/profiles:/

That can be something like this:

:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/

And set this values on gnome-terminal to make your desired theme.

dconf write /org/gnome/terminal/legacy/profiles:/<profile id>use-theme-colors "false"
dconf write /org/gnome/terminal/legacy/profiles:/<profile id>background-color "'rgb(0,43,54)'"
dconf write /org/gnome/terminal/legacy/profiles:/<profile id>foreground-color "'rgb(131,148,150)'"

For example:

dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/use-theme-colors "false"
dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/background-color "'rgb(0,43,54)'"
dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/foreground-color "'rgb(131,148,150)'"

Method2:

Also you can do this with gsettings:

gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ use-theme-colors false    
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ background-color 'rgb(0,43,54)'
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/ foreground-color 'rgb(131,148,150)'

That b1dcc9dd-5262-4d8d-a863-c897e6d979b9 is my profile id and you can find yours with this command:

gsettings get org.gnome.Terminal.ProfilesList default
4
  • Just an aside, the b1dcc9dd-5262-4d8d-a863-c897e6d979b9 is also my profile ID; maybe it's the default or maybe you're using vagrant like me
    – Mendhak
    Sep 19 '17 at 13:09
  • Hey thanks - this worked for me, I see now I was missing a : in what I was originally trying. My takeaway from this is that 'solarized' dark can't be done directly instead it has to be done the way you've illustrated.
    – Mendhak
    Sep 19 '17 at 13:13
  • @Mendhak I'm glad I could help you Sep 19 '17 at 15:49
  • @AliRazmdideh, is there a command line to swap between profiles, instead of modifying the current one? Feb 25 '18 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.