Where has the gnome terminal GTK3 style configuration moved to in Ubuntu 16.04?
This works for me:
/* gnome-terminal */
@define-color terminal_bg #300a24;
TerminalScreen {
-TerminalScreen-background-darkness: 0.95;
background-color: @terminal_bg;
color: #fff;
}
TerminalScreenContainer .scrollbar:hover:not(.slider),
TerminalScreenContainer .scrollbar.dragging:not(.slider) {
background-color: alpha(@scrollbar_track_color, 0.4);
}
/* Since .hovering class is not working here, we always
use the same radius */
TerminalScreenContainer .scrollbar.slider.hovering,
TerminalScreenContainer .scrollbar.slider.dragging {
border-radius: 1px;
}
TerminalScreenContainer .scrollbar {
background-color: transparent;
}
TerminalWindow .notebook tab:active {
padding: 0;
border: none;
background-color: #222;
}
The code I added is at the bottom. The file I edited is ~/.themes/ORIG-Ambiance/gtk-3.0/apps/gnome-terminal.css
.
Notes:
I just copied over the Ambiance folder from
/usr/share/themes
and renamed it so that I don't need to use elevated privileges while editing the file.I found that using
#555
made it difficult to see the text in the tab.I also changed the
selected_fg_color
to be sure of which theme is which and that's why the scrollbar isn't orange ;)
Logging out/closing all my programs and logging back in applied the theming after all.
The GTK API reference for GtkCssProvider (the unstable dev version - I cant find the equivalent sections for stable) explains/confirms how GTK will read CSS code for a theme on startup:
An application can cause GTK+ to parse a specific CSS style sheet by calling gtk_css_provider_load_from_file() and adding the provider with gtk_style_context_add_provider() or gtk_style_context_add_provider_for_screen().
In addition, certain files will be read when GTK+ is initialized. First, the file $XDG_CONFIG_HOME/gtk-3.0/gtk.css is loaded if it exists.
Then, GTK+ tries to load $HOME/.themes/theme-name/gtk-3.0/gtk.css, falling back to datadir/share/themes/theme-name/gtk-3.0/gtk.css, where theme-name is the name of the current theme (see the "gtk-theme-name" setting) and datadir is the prefix configured when GTK+ was compiled, unless overridden by the GTK_DATA_PREFIX environment variable.
Previous experience suggested gnome-terminal all you needed to do was close all gnome-terminal tabs and windows to make new theming take effect.
As per the docs, maybe GTK needed to go through its initialisation, or there may have been a gnome-terminal
process still running, requiring me to logout and back in.