1

The embedded terminal of Gedit in my 16.04 session is not following the default ubuntu theme, and does not seem to be configurable in any way.

More precisely, it follows the username@hostname color of the ubuntu theme (some kind of bright green) but the background is plain white (should be 'aubergine') and the text is black (should be white).

This problem had been addressed for earlier versions of ubuntu, but in 16.04 things seem to have changed:

  • there is no Gedit entry in gconf-editor
  • editing directly the colors in dconf-editor has no effect whatsoever
  • clearing the plugin's palette in is prohibited, one can only enter an empty []

So this is NOT a duplicate: none of the earlier solutions work and there seems to be something specific to 16.04 with respect to this problem. My impressions is that there is an issue with the way gconf settings are handled, maybe a bug in the terminal plugin script terminal.py (located in /usr/lib/x86_64-linux-gnu/gedit/plugins) but this exceeds my competence, so any help is welcome.

5
  • I posted an answer for 16.04. Try it out.
    – muru
    Jan 16, 2017 at 5:52
  • Just did, no luck. You seem to be digging in the right direction though.
    – Marc
    Jan 19, 2017 at 3:03
  • @Marc I had the same problem and fixed it by commenting out the if statement shown in the answer by muru in the terminal.py file (mine was located in /usr/lib/x86_64-linux-gnu/gedit/plugins/). If you only keep the line that sets the settings to the ones defined by the dconf editor, it should work. Make sure that it has the proper identation.
    – Praan
    Feb 25, 2017 at 23:17
  • Thanks for the pointer. I tried (can't post the code in comments apparently?) and the terminal plugin won't launch with the commented code. The script sets profile to "self.settings_try_new("org.gnome.Terminal.ProfilesList")" apparently. But there is no such entry in the dconf tree. Maybe that's the issue?
    – Marc
    Feb 27, 2017 at 4:32
  • @Marc I think your identation might be off in the code. Identation defines scopes in python code, like curly brackets do in C. I'm going to write a proper answer to clarify what I meant.
    – Praan
    Feb 27, 2017 at 13:48

1 Answer 1

3

From this answer of user muru, I have found a workaround which worked for me. First, find the python script terminal.py located in /usr/lib/x86_64-linux-gnu/gedit/plugins/. Or you can enter the command locate terminal.py in the Ubuntu terminal. In this python script, you can find the following code block:

def get_profile_settings(self):
    profiles = self.settings_try_new("org.gnome.Terminal.ProfilesList")

    if not profiles:
        default_path = "/org/gnome/terminal/legacy/profiles:/:" + profiles.get_string("default") + "/"
        settings = Gio.Settings.new_with_path("org.gnome.Terminal.Legacy.Profile",
                                              default_path)
    else:
        settings = Gio.Settings.new("org.gnome.gedit.plugins.terminal")

    return settings

Now change this to:

def get_profile_settings(self):
    profiles = self.settings_try_new("org.gnome.Terminal.ProfilesList")

#    if not profiles:
#        default_path = "/org/gnome/terminal/legacy/profiles:/:" + profiles.get_string("default") + "/"
#        settings = Gio.Settings.new_with_path("org.gnome.Terminal.Legacy.Profile",
#                                              default_path)
#    else:

    settings = Gio.Settings.new("org.gnome.gedit.plugins.terminal")

    return settings

Now the settings entered via the dconf-editor should work. Be aware that you might have to change it again in the future if the gedit-plugins package gets updated.

2
  • Problem with this is that these changes will be lost when the package is next upgraded (which might not be for a long time, though).
    – muru
    Feb 27, 2017 at 14:11
  • Finally something that works! Probably worth mentioning issue/fix this to the gnome team.
    – Marc
    Feb 28, 2017 at 1:48

You must log in to answer this question.

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