31

I've just updated to 11.10 and now my embedded terminal in gedit does not match my default terminal. I hate looking at a white and black terminal. Does anyone know how to make the embedded terminal match the default terminal?

This is a screenshot:

Screenshot

I want my embedded terminal in gedit to match my default terminal.

N.N.
  • 18,219
Hugo
  • 922

6 Answers6

36
  1. Make sure you have the following packages installed:

  2. Open up gconf-editor and navigate to apps ➜ gnome-terminal and select a profile:

    enter image description here

  3. Now open up dconf-editor and navigate to org ➜ gnome ➜ gedit ➜ plugins ➜ terminal and uncheck the use-theme-colors key:

    enter image description here

  4. From gconf-editor, copy the values of the

    • background-color
    • foreground-color
    • palette

    over to the corresponding keys in dconf-editor. The embedded terminal should now match a regular gnome-terminal.

    enter image description here

Ashesh
  • 185
  • 1
  • 2
  • 15
Isaiah
  • 59,344
  • Thank you for the very detailed answer. Unfortunately when I am changing the values of the gedit terminal and then leave the edit text. The value I changed resets. Am I doing something stupid here? – Hugo Oct 20 '11 at 09:59
  • Wait I hit enter instead of unfocusing. Works great thanks. – Hugo Oct 20 '11 at 10:11
  • works great but my palette didn't seem to transfer. wish there were options in gedit->preferences->plugins->preferences. – waspinator Mar 08 '12 at 03:37
  • 5
    This resolves the white on white issue on Precise (likely bug with the Ambiance theme) – prusswan Mar 23 '12 at 22:40
  • 1
    In fact, the good way to do what you want to do is very close to the precedent solution, except on one little point. If you want to modify your palette colour of 'Gnome terminal', without re-modified it's value for the embedded terminal with dconf-editor, the solution is to simply delete the value of the palette with dconf-editor. Like in the precedent solution, which said to copy the value of the palette parameter, but just delete it (fill the value of embedded terminal plugin palette parameter to a blank).

    Naereen.

    –  Jun 27 '12 at 17:24
  • I can confirm that Naereen's solution resets the colour profile to the one defined in my ~/.bashrc. – Glutanimate Aug 26 '13 at 23:05
  • Changing my terminal's typeface and font size in dconf-editor has no effect, even after a restart of gedit. – EMBLEM Mar 18 '16 at 03:42
18

This is for gedit 3

Same problem here white on light gray.

I manually edited /usr/lib/gedit/plugins/terminal.py. Terminal used is xterm.

Search for:

fg = context.get_color(Gtk.StateFlags.NORMAL)
bg = context.get_background_color(Gtk.StateFlags.NORMAL)

I replace with

fg = Gdk.RGBA(0, 0, 0, 1)
bg = Gdk.RGBA(1, 1, 1, 1)

Info: fg = black text, bg = white background

Eliah Kagan
  • 117,780
John
  • 181
  • 1
    I had to do locate terminal.py to find it on 13.10. It was hiding at /usr/lib/x86_64-linux-gnu/gedit/plugins/terminal.py – Amanda Feb 13 '14 at 01:05
4

Make sure you haven't ticked Use colors from system theme then it should work:

enter image description here

htorque
  • 64,798
1

Open gconf-editor and go to apps->gnome-terminal->profiles->Default

  • Uncheck the use-theme-colors option.
  • Set foreground color: #FFFFFF
  • Set background color: #000000

This will set the text to white and the background to black. It will set this for both the terminal and embedded terminal, if you would like to use different colors for each, then do this instead.

Open gconf-editor and go to apps->gedit-2->plugins

  • Create a new key named use_theme_colors
  • Set the type to: Boolean
  • Set the value to: False
  • Create a new key named foreground_color
  • Set the type to: String
  • Set the value to: #FFFFFF
  • Create a new key named background_color
  • Set the type to: String
  • Set the value to: #000000

Edit the file /usr/lib/gedit-2/plugins/terminal.py

Underneath the line:

GCONF_PROFILE_DIR = "/apps/gnome-terminal/profiles/Default"

Add a new line:

GCONF_GEDIT_DIR = "/apps/gedit-2/plugins"

Then replace the lines:

if not gconf_get_bool(self.GCONF_PROFILE_DIR + "/use_theme_colors"):
fg_color = gconf_get_str(self.GCONF_PROFILE_DIR + "/foreground_color", None)
bg_color = gconf_get_str(self.GCONF_PROFILE_DIR + "/background_color", None)

With:

if not gconf_get_bool(self.GCONF_GEDIT_DIR + "/use_theme_colors"):
fg_color = gconf_get_str(self.GCONF_GEDIT_DIR + "/foreground_color", None)
bg_color = gconf_get_str(self.GCONF_GEDIT_DIR + "/background_color", None)

Now you can the set the colors for the embedded terminal only, with the keys you created in apps->gedit-2->plugins

Gary
  • 111
1

Inspecting terminal.py for Ubuntu 16.04, it seems it loads some legacy profile:

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

Inspecting org.gnome.terminal.legacy.profiles: in dconf-editor, there was such a profile. After deleting it with:

dconf reset -f /org/gnome/terminal/legacy/profiles:/

I could change settings in org.gnome.gedit.plugins.terminal and have them take effect. For background-color, I had to disable use-theme-colours first.

muru
  • 197,895
  • 55
  • 485
  • 740
0

in 13.04, the gconf-editor path to the properties has changed to: org -> gnome -> gedit -> terminal

Nico Grunfeld
  • 211
  • 1
  • 4
  • 11