You are not logged in.

#1 2025-10-02 02:36:28

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,427
Website

Theming GTK-4 apps

Some apps like pavucontrol (libadwaita apps, I'm guessing) are not themed properly. Install dconf-editor and, for the default theme (bunsen-yaru-bark-dark) set org>gnome>desktop>interface>color-scheme to 'prefer-dark" and interface>gtk-theme to 'bunsen-yaru-bark-dark' and Apply.

Last edited by johnraff (2025-12-03 01:20:44)


I don't care what you do at home. Would you care to explain?

Offline

#2 2025-10-02 12:44:09

darknetmatrix
Member
From: /home/labs
Registered: 2015-09-29
Posts: 192
Website

Re: Theming GTK-4 apps

^ great tip @hhh, now my transmission app is also dark, which I prefer


⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system linux user # 527315
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Offline

#3 2025-10-26 09:46:22

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,891
Website

Re: Theming GTK-4 apps

Edited by johnraff - pasted in some comments from other threads - to try to show the discussion flow:

sleekmason wrote:

Is there a fix for those programs requiring gtk-4.0?

Johnraff wrote:
A fix for what? What issues have come up with transmission-gtk and file-roller?

Both use gtk-4.-0, and will open in white unless the dconf settings @hhh supplied in another post are utilized.

sleekmason wrote:

His idea was to change the preference for gtk-colorscheme under /gtk/gnome/desktop/interfaces to "prefer-dark", which will then use the default Adwaita-dark theme for the colors. Nice find!  However, this can effect other items as well (pavucontrol comes to mind), but, the Yaro theme is close enough that people probably wouldn't be bothered by the difference  for just a few programs, if the fix works.

In short, I would give the dconf setting a shot first to see how it does overall, and place a dconf file in ~/.config with the adjusted setting.  otherwise, change programs or just accept the white color.

Last edited by johnraff (2025-12-03 01:45:23)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#4 2025-10-26 11:04:53

sleekmason
zoom
Registered: 2018-05-22
Posts: 1,162
Website

Re: Theming GTK-4 apps

@johnraff

https://forums.bunsenlabs.org/viewtopic … 11#p145811

@hhh wrote:
Some apps like pavucontrol (libadwaita apps, I'm guessing) are not themed properly. Install dconf-editor and, for the default theme (bunsen-yaru-bark-dark) set org>gnome>desktop>interface>color-scheme to 'prefer-dark" and interface>gtk-theme to 'bunsen-yaru-bark-dark' and Apply.


This may work with just the 'prefer-dark' setting ...   I am not sure, but it seemed to still only grab the Adwaita theme, which would probably work out fine color wise.  I've only tested on my own system for this one.  If it actually picks up the Yaru theme, then all the better.  Seems a decent solution overall if it serves.

Offline

#5 2025-10-27 04:44:19

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,891
Website

Re: Theming GTK-4 apps

^I set both color-scheme to 'prefer-dark' and gtk-theme to 'bunsen-yaru-bark-dark' but file-roller and transmission are still white. I couldn't find a dconf-editor "apply" button though.

You, hhh and darknetmatrix all seem to get results with this - any idea what I might be doing wrong?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#6 2025-10-27 05:10:24

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,891
Website

Re: Theming GTK-4 apps

What I did stumble on, though, was:

GTK_THEME='bunsen-yaru-bark-dark' file-roller

and

GTK_THEME='bunsen-yaru-bark-dark' transmission-gtk

worked!

So something ought to be doable.

I also tried copying ~/.config/gtk-3.0/settings.ini into ~/.config/gtk-4.0/
It was clearly reading the file because I got warnings about "unknown key" for gtk-toolbar-style, gtk-toolbar-icon-size, gtk-button-images and gtk-menu-images "in /home/john/.config/gtk-4.0/settings.ini", but with or without those entries the file seemed to make no difference. The GTK_THEME variable did though.

BTW our bunsen-yaru themes do have gtk-4.0 directories with content, so GTK-4 apps ought to use it, no?

EDIT: it gets more confusing.
Now, with ~/.config/gtk-4.0/settings.ini containing:

[Settings]
gtk-theme-name=bunsen-yaru-bark-dark
gtk-icon-theme-name=labbe-icons-bark
gtk-font-name=Sans 10
gtk-cursor-theme-name=DMZ-White
gtk-cursor-theme-size=0
gtk-enable-event-sounds=0
gtk-enable-input-feedback-sounds=0
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintslight
gtk-xft-rgba=rgb

transmission-gtk and pavucontrol come up nicely themed, but file-roller is still white. roll
Without that gtk-4.0/settings.ini they all come up white.

But file-roller still responds to

GTK_THEME='bunsen-yaru-bark-dark' file-roller

Last edited by johnraff (2025-10-27 05:32:38)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#7 2025-10-27 05:18:33

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,427
Website

Re: Theming GTK-4 apps

Try setting the dconf-editor window to maximize or full-screen, the "Apply" button should appear lower-right.

8FmQzkfQ_t.png


I don't care what you do at home. Would you care to explain?

Offline

#8 2025-10-27 05:44:11

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,891
Website

Re: Theming GTK-4 apps

No hint of an Apply button:
qF6jRZRl.png
But those two previous settings do seem to have "taken" somehow - they now appear in the interface without opening up the key.

But file-roller is still stubbornly white (except with that envvar), while transmission-gtk and pavucontrol (any other gtk4 apps we use?) are nicely dark.

Discussion:
https://www.reddit.com/r/archlinux/comm … tk4_theme/
and
https://wiki.archlinux.org/title/GTK#GTK_3_and_GTK4

PS I guess if all the other GTK4 apps turn out to be co-operative, then swapping out file-roller for engrampa would be an option...

Last edited by johnraff (2025-10-27 06:04:36)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#9 2025-10-30 08:10:15

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,891
Website

Re: Theming GTK-4 apps

If you put the gtk theme in the environment, then file-roller uses it.
There are many ways to do that, but for example, add this line to ~/.config/bunsen/environment:

export GTK_THEME='bunsen-yaru-bark-dark'

Log out and back in and file-roller will use that theme.

But that means if a user changes the theme in lxappearance then file-roller won't follow (it wouldn't anyway of course), so some kind of hook would be needed to rewrite that line when the theme is changed. Not impossible at all.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#10 2025-10-31 01:19:13

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,891
Website

Re: Theming GTK-4 apps

^ No forget that. With GTK_THEME set in the environment then all other apps get locked up too. Lxappearance can't change the theme.

Another idea though - a wrapper script around any uncooperative app like file-roller, that checks ~/.config/gtk-3.0/settings.ini for the current GTK theme and force-feeds it to the app before running it. Let me play with it...

...this seems to work.
file-roller.wrapper

#!/bin/bash

gtk_file=~/.config/gtk-3.0/settings.ini
gtk3_theme=$( sed -nE 's/[[:blank:]]*gtk-theme-name[[:blank:]]*=[[:blank:]]*([[:alnum:]-]+).*$/\1/p' "$gtk_file" )

GTK_THEME="$gtk3_theme" file-roller "$@"

file-roller will come up using the currently set GTK theme. The theme must have a gtk4 directory though (as the bunsen-yaru themes do). Make such a .wrapper script for whichever uncooperative apps need to be told the GTK theme - there shouldn't be very many right now, and that *.wrapper command can go in a user .desktop file too.
Just call 'fileroller.wrapper' instead of file-roller.

Alternatively, a script that will do the same thing for whatever app you tell it:
gtkset

#!/bin/bash

app=$1
shift
gtk_file=~/.config/gtk-3.0/settings.ini
gtk3_theme=$( sed -nE 's/[[:blank:]]*gtk-theme-name[[:blank:]]*=[[:blank:]]*([[:alnum:]-]+).*$/\1/p' "$gtk_file" )

GTK_THEME="$gtk3_theme" "$app" "$@"

That way you only need one script but you have to call it like this:

gtkset file-roller <file>

Last edited by johnraff (2025-10-31 02:30:08)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#11 2025-10-31 02:26:04

sleekmason
zoom
Registered: 2018-05-22
Posts: 1,162
Website

Re: Theming GTK-4 apps

johnraff wrote:

Another idea though - a wrapper script around any uncooperative app like file-roller, that checks ~/.config/gtk-3.0/settings.ini for the current GTK theme and force-feeds it to the app before running it. Let me play with it...

Will this method work for any theme without gtk-4.0 support?  Those running older themes will still be presented with white dialogs.

Offline

#12 2025-10-31 02:32:21

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,891
Website

Re: Theming GTK-4 apps

^

johnraff wrote:

The theme must have a gtk4 directory though

So, no. I don't think any method will work to set a non-GTK4 theme with a GTK4 app.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#13 2025-11-21 07:24:48

cog
Member
From: The Southwest
Registered: 2015-10-27
Posts: 668
Website

Re: Theming GTK-4 apps

@johnraff, what you want installed is the xdg-desktop-portal-gtk package and a well crafted .config/gtk-4.0/settings.ini file.  The file will mostly handle font sizes and then the desktop portal will pick up on the dconf binary.  It's GTK4 wierdness.

you need to run this command to get the dconf binary in place

gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"

this is an example of your gtk-4.0/settings.ini


[Settings]
gtk-theme-name=Adwaita-dark
gtk-icon-theme-name=Adwaita
gtk-font-name=Inter 12
gtk-cursor-theme-name=Adwaita
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-application-prefer-dark-theme=1

Offline

#14 2025-11-21 07:28:35

cog
Member
From: The Southwest
Registered: 2015-10-27
Posts: 668
Website

Re: Theming GTK-4 apps

qt6 isn't much better..

Offline

#15 2025-11-21 08:12:38

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,891
Website

Re: Theming GTK-4 apps

cog wrote:

@johnraff, what you want installed is the xdg-desktop-portal-gtk package and a well crafted .config/gtk-4.0/settings.ini file.  The file will mostly handle font sizes and then the desktop portal will pick up on the dconf binary.  It's GTK4 wierdness.

you need to run this command to get the dconf binary in place

gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"

this is an example of your gtk-4.0/settings.ini


[Settings]
gtk-theme-name=Adwaita-dark
gtk-icon-theme-name=Adwaita
gtk-font-name=Inter 12
gtk-cursor-theme-name=Adwaita
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-application-prefer-dark-theme=1

Thanks cog - I'll have a play with this. Is there any way to keep the GTK4 theme synchronized with GTK3? However, right now, the number of GTK4 apps is small so just having a dark theme will do.

The small script I posted before forces the GTK3 theme to GTK4 apps via an environment variable. It works as long as the theme also has GTK4 configs.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#16 2025-11-21 17:39:53

cog
Member
From: The Southwest
Registered: 2015-10-27
Posts: 668
Website

Re: Theming GTK-4 apps

@johnraff I think the only way to keep them identical right now is to use a theme like adw-gtk3

https://github.com/lassekongo83/adw-gtk3

Offline

#17 2025-11-21 17:42:49

cog
Member
From: The Southwest
Registered: 2015-10-27
Posts: 668
Website

Re: Theming GTK-4 apps

Also yall might wanna look into nwg-look instead of lxappearance for setting themes.  It’s in the Trixie repos.

Offline

#18 2025-11-22 00:04:32

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,427
Website

Re: Theming GTK-4 apps

cog wrote:

Also yall might wanna look into nwg-look instead of lxappearance for setting themes.  It’s in the Trixie repos.

I use nwg-look (aka GTK Settings) on Wayland.

Regarding GTK4 themes, if you really want to get fancy you can set colors by backing up the symlink to the ~/.config/gtk-4.0/gtk.css file and creating a new one. For example...

@import 'colors.css';
 @define-color accent_color #3daee9;

Source...

https://discuss.kde.org/t/simple-hack-t … asma/29444


I don't care what you do at home. Would you care to explain?

Offline

#19 2025-11-22 17:47:23

cog
Member
From: The Southwest
Registered: 2015-10-27
Posts: 668
Website

Re: Theming GTK-4 apps

@hhh cool tip!

Offline

#20 2025-11-24 05:20:08

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,427
Website

Re: Theming GTK-4 apps

^ Thanks, been using that accent color tweak for a while now.


I don't care what you do at home. Would you care to explain?

Offline

Board footer

Powered by FluxBB