Make gedit embedded terminal colours the same as the default terminal
Solution 1:
-
Make sure you have the following packages installed:
dconf-tools
gconf-editor
-
Open up
gconf-editor
and navigate to apps ➜ gnome-terminal and select a profile: -
Now open up
dconf-editor
and navigate to org ➜ gnome ➜ gedit ➜ plugins ➜ terminal and uncheck the use-theme-colors key: -
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.
Solution 2:
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
Solution 3:
Make sure you haven't ticked Use colors from system theme then it should work:
Solution 4:
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
Solution 5:
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.