4

In a script, I'm trying to set the configuration for gnome-terminal. Setting the background color works, but it is overriden by this one option "Use colors from system theme" in the Colors tab in the profile settings. How can I deactivate this with something like gsettings or dconf? I tried, unsuccessfully, to find the right value with dconf-editor.

4

Assuming you're changing the default profile that comes with gnome-terminal, you can use this command to change the preference to use themes colors.

dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/use-theme-colors false

Here, b1dcc9dd-5262-4d8d-a863-c897e6d979b9 is the UUID of the default profile of Gnome terminal.

If you want to change settings for another profile, you need to know its UUID. The good thing is most users use the default profile, so it should work most of the time.


Addition from OPs comment

UUID value for default profile can be fetched using this command

gsettings get org.gnome.Terminal.ProfilesList default

So, getting it in a variable say TPROFILE, stripping off ' from beginning and end with TPROFILE=${TPROFILE:1:-1} and using it as $TPROFILE in place of UUID will ensure that default profile is being changed, even if the UUID is changed by the user.

2
  • 2
    Awesome, it works. The way I get the UUID is like this: TPROFILE=$(gsettings get org.gnome.Terminal.ProfilesList default); TPROFILE=${TPROFILE:1:-1}. Then use $TPROFILE in place of the UUID. This way it'll still work if the UUID of the default profile should change, for whatever reason. – Lasse Meyer Sep 16 '16 at 20:31
  • @LasseMeyer that's great! Edited the answer to add your info. Thanks for the feedbacks – Anwar Sep 17 '16 at 4:15

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.