Ubuntu – Per-application GTK3 theme

gnomegtkthemes

On my Ubuntu 17.10, I want to be able to launch the gnome-terminal app with either a large padding (for full screen usage) or no padding at all (for windowed usage).

I was able to apply padding via this answer on Stack Overflow: https://askubuntu.com/a/887616/425695 .
The trick is to have the file ~/.config/gtk-3.0/gtk.css being:

vte-terminal {
    padding: 10px;
}

However now all my terminals have padding,
and I want to be able to choose between padding or no padding.

One hack would be to change ~/.config/gtk-3.0/gtk.css on the fly just before launching a terminal,
but that's really dirty.

Another option would be to give GTK an environemtn variable, as we can see in on archlinux here or on this article:

$ GTK_THEME=<theme name> gnome-terminal

The problem is: GNOME seems to ignore any theme I pass this way

The following examples launches two times a terminal with the normal theme instead of the "HighContrast" one:

$ ls /usr/share/themes/
Ambiance/         Default/          Emacs/            HighContrast/     my-special-theme/ Radiance/         Raleigh/
$ GTK_THEME=HighContrast gnome-terminal
Warning: DESKTOP_STARTUP_ID not set and no fallback available.
$ GTK_THEME=/usr/share/themes/HighContrast/ gnome-terminal
Warning: DESKTOP_STARTUP_ID not set and no fallback available.

What am I doing wrong?

EDIT 2018-10-25 After @DKBose's comment

OK, it works with 'gedit':

$ GTK_THEME=HighContrast gedit

At least now we know why it didn't work with gnome-terminal
But now it's going to be harder to do what I want to do.

I guess I'll have to use another terminal emulator?
I guess urxvt must have an option for that?

Best Answer

  • It seems that gnome-terminal ignores GTK_THEME as DK Bose suggested.

  • Related Question