5

In Ubuntu 16.04 LTS and before, the gThumb application (version 3.4.3) has a light background in its menus, its browser and its dialogues – like white or light grey. So the gThumb application fits nicely with my light Ubuntu desktop and the other applications.

Now since Ubuntu 17.04 or 17.10, and so also with Ubuntu 18.04 LTS beta, the gThumb application (version 3.6.0 in Ubuntu 18.04) has a dark background for all its menus, its browser and its dialogues – like black or dark grey. This breaks the harmony with my Ubuntu desktop and the other applications which all use light backgrounds, since I use a light Ubuntu theme. (Actually I am using Xubuntu but that's not the point here.)

Is there a way to configure gThumb's background color for menus, browser and dialogues? I didn't find any possibility, also not in dconf Editor.

pomsky
  • 67,112
  • 21
  • 233
  • 243
Fidelis
  • 142
  • 1
  • 8
  • 1
    gThumb 3.8.0 available in Ubuntu 20.04 picks up the system theme correctly, no need to change anything. So probably that's only version 3.6 issue. – raj Jul 09 '20 at 14:57
  • 2
    @raj But I can still reproduce on my Ubuntu 20.04. gThumb always have dark background and dialogs regardless of the theme. If I remember correctly it was an upstream design choice to have these dark elements by default in image and video applications to provide better contrast and focus. So the same can be observed in other applications like Videos, Image Viewer, Shotwell etc. – pomsky Jul 09 '20 at 22:57
  • Well... i just checked with other themes, and actually, with Yaru or Adwaita the background is dark as you describe. I'm using Radiance (to be precise, my own modified version of Radiance, but the same is true for original Radiance) and the background is light as it should be. Something must be missing in the default themes. – raj Jul 12 '20 at 17:28
  • 1
    @raj Or probably because Radiance is a light theme which doesn't support a dark counterpart. – pomsky Jul 12 '20 at 18:02

3 Answers3

8

You can run gThumb with your preferred GTK+ theme and its variant (light/dark) by the following command

GTK_THEME=<Theme-Name>:<Theme-variant> gthumb

for example

GTK_THEME=Ambiance:light gthumb

If you wish to make a change to the gThumb launcher so that it always launches the application with your preferred theme, then follow the steps below.

  1. Copy the correct .desktop file associated to gThumb (it should be called org.gnome.gThumb.desktop or gthumb.desktop or something similar) from /usr/share/applications to ~/.local/share/applications.

  2. Open the copied .desktop file using a text editor.

  3. Look for the Exec= line. Add env GTK_THEME=<Theme-Name>:<Theme-variant> just after Exec= so that it now looks like

    Exec=env GTK_THEME=<Theme-Name>:<Theme-variant> gthumb %U
    

    for example

    Exec=env GTK_THEME=Ambiance:light gthumb %U
    
  4. Save the .desktop file.

pomsky
  • 67,112
  • 21
  • 233
  • 243
1

For anyone who wants to auto grab the current desktop theme when launching (e.g dark/night mode switching)

Use the following solution:

Create script: /usr/local/bin/gthumb-themed

#!/bin/bash

eval theme=$(gsettings get org.gnome.desktop.interface gtk-theme)
GTK_THEME=$theme gthumb "$@"

Make it executable: sudo chmod +x /usr/local/bin/gthumb-themed

And modify your /usr/share/applications/org.gnome.gThumb.desktop to use the new Exec

...
Exec=gthumb-themed %U
...
[Desktop Action new-window]
...
Exec=gthumb-themed --new-window

It'll now automatically grab the default theme at startup.

Khaled
  • 111
  • 3
0

If you start your graphical session with a display manager like GDM or LightDM then you can set the GTK theme environment variable in your ~/.xprofile.
This is automatically picked up by the display manager without the need to modify individual .desktop files for each application.

The syntax is GTK_THEME=Theme:variation, e.g.:

File: ~/.xprofile
───────────────────────────────
export GTK_THEME=Adwaita:light

And then logout/login again. You can then check whether this was correctly set using your terminal:

> echo $GTK_THEME
Adwaita:light

More info on the Arch wiki xprofile page.

Radu Potop
  • 170
  • 4