You are not logged in.

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

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

^ 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

#22 2025-11-26 02:24:46

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

cog wrote:

@johnraff, what you want installed is the xdg-desktop-portal-gtk package...

@cog sorry it took me so long to get back to this, but I just checked out that package and it says:

xdg-desktop-portal-gtk provides a GTK+/GNOME implementation for the desktop-agnostic xdg-desktop-portal service. This allows sandboxed applications to request services from outside the sandbox...

Isn't this something for flatpak apps?


...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

#23 2025-11-27 21:38:24

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

johnraff wrote:
cog wrote:

@johnraff, what you want installed is the xdg-desktop-portal-gtk package...

@cog sorry it took me so long to get back to this, but I just checked out that package and it says:

xdg-desktop-portal-gtk provides a GTK+/GNOME implementation for the desktop-agnostic xdg-desktop-portal service. This allows sandboxed applications to request services from outside the sandbox...

Isn't this something for flatpak apps?

This is for Wayland only, as far as I know. Not for carbon, which is still X11 based. xdg-desktop- anything shouldn't apply to carbon. Not any daemon, that's for sure.

-edit- When in doubt, start with the Arch Wiki...

https://wiki.archlinux.org/title/XDG_Desktop_Portal


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

Offline

#24 2025-11-29 01:02:25

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

^OK smile

...one more thing not to have to think about, at least for now.


...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

#25 2025-11-29 18:29:51

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

^ the gtk portal is a flatpak thing but the problem is all these newer gnome apps (simple-scan, probably my best test case) get info from the portal even if they aren’t flatpaks.  There’s no way to make them respect the dark variant gsettings thing I mentioned previously unless the portal is installed.

Offline

#26 2025-11-29 19:54:14

DeepDayze
Like sands through an hourglass...
From: In Linux Land
Registered: 2017-05-28
Posts: 1,921

Re: [DONE] A couple of last-minute app substitutions for Carbon

cog wrote:

^ the gtk portal is a flatpak thing but the problem is all these newer gnome apps (simple-scan, probably my best test case) get info from the portal even if they aren’t flatpaks.  There’s no way to make them respect the dark variant gsettings thing I mentioned previously unless the portal is installed.

Yes think of the portal as a link between the flatpak app and the host system it's running on.


Real Men Use Linux

Offline

#27 2025-11-29 21:35:22

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

Ugg. Anyone miss just trying to get a Wi-Fi driver to work? Simpler times.


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

Offline

#28 2025-11-30 01:46:46

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

cog wrote:

(simple-scan, probably my best test case)

Thanks for that hint. I use simple-scan sometimes.
It looks OK now for me on Bookworm, so I guess the theming issues show up with the upgrade to Trixie?


...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

#29 2025-11-30 01:52:27

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

cog wrote:

There’s no way to make them respect the dark variant gsettings thing I mentioned previously unless the portal is installed.

If you just want to enforce some dark theme on an app you use only occasionally, then passing the environment variable in the command seems to work, eg:

GTK_THEME=Adwaita-dark <rest of command line>

It's neccessary that the theme has GTK4 support of course.


...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

#30 2025-11-30 02:01:56

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

xfce4-terminal configs

Just a note for devs that the configuration for xfce4-terminal is now: ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-terminal.xml

It's not all bad news though, because if you have xfconf installed (most xfce apps will pull it in) then you can use xfconf-query to script backup and restore configs easily, and restored configs will appear immediately because of the xconf daemon.

---
btw I'm quite tired of having to remember whether to type xfce or xfce4. neutral


...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

#31 2025-11-30 03:50:49

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

Exxfconfxfwm4scuse me?

dconf it all!

*grumbles in xml*


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

Offline

#32 2025-11-30 06:15:56

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

@johnraff yeah that works but fonts are terribly messed up.  I’ve followed the problem from my Debian spin up to arch and back down to Debian and the only solution is the portal.  Not saying yall need to implement it but it’s the best solution to the shituation that GTK4 is that I’ve found.  If you can do it all in env I’d be super grateful to know how.

Last edited by cog (2025-11-30 06:36:07)

Offline

#33 2025-11-30 08:21:00

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

cog wrote:

fonts are terribly messed up

Can you give me an example of something to check that? Like, is it the font rendering that's off? Or the font specified in the theme is not used?


...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

#34 2025-11-30 16:39:39

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

@johnraff this was just tested with file-roller from the trixie repos

fogFnzG.th.png
Here's without any of our methods used

fogFBbs.th.png
Here's with passing the env variable like you were saying, notice it ignores font settings and produces artifacts from the hamburger menu


fogFoXf.th.png
Here's with xdg-desktop-portal-gtk, gsettings prefer dark, and .config/gtk4/settings.ini, font settings are respected and hamburger menu artifacts disappear

Offline

#35 Yesterday 03:51:57

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

^@cog many thanks for going to that trouble.
I now see what you're getting at, and the -portal- version is definitely better.
Personally, for an app I'm only using occasionally, I could live with the envvar version, but for something we're shipping in a system for general use, xdg-desktop-portal-gtk definitely looks more professional. I'll give it a try. cool

It only remains to see if there's a way to synchronize the theme with whatever GTK3 theme the user chooses. Maybe a symlink from /gtk4/settings.ini to gtk3/settings.ini would be enough?


...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

#36 Yesterday 05:02:03

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

^Follow-up.

@cog as far as I can tell, .config/gtk4/settings.ini is having no effect at all. If your suggested file is present, 'file-roller' throws these warnings:

(org.gnome.FileRoller:1989): Gtk-WARNING **: 13:11:45.983: Unknown key gtk-toolbar-style in /home/john/.config/gtk-4.0/settings.ini

(org.gnome.FileRoller:1989): Gtk-WARNING **: 13:11:45.985: Unknown key gtk-toolbar-icon-size in /home/john/.config/gtk-4.0/settings.ini

(org.gnome.FileRoller:1989): Gtk-WARNING **: 13:11:45.985: Unknown key gtk-button-images in /home/john/.config/gtk-4.0/settings.ini

(org.gnome.FileRoller:1989): Gtk-WARNING **: 13:11:45.985: Unknown key gtk-menu-images in /home/john/.config/gtk-4.0/settings.ini

(org.gnome.FileRoller:1989): Adwaita-WARNING **: 13:11:46.036: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported. Please use AdwStyleManager:color-scheme instead.

If I remove those deprecated lines, there is no change in behaviour. If I make the file a symlink to  .config/gtk3/settings.ini, or  delete the file completely, the behaviour stays the same. That is, the only thing that makes the file-roller window dark is gsettings:

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

+ installing xdg-desktop-portal-gtk.

But, if I use 'gtkset file-roller' then it follows the current GTK3 theme. Yes, with wrong fonts and artifacts round the menu, but at least it's dark or light as needed by the current GTK3 theme.

So that's the tradeoff.

Here's a proof-of-concept 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" "$@"

PS maybe if there was a way to auto-detect whether the chosen GTK3 theme is light or dark and use that to toggle gsettings then that would be the way to go.

Last edited by johnraff (Yesterday 05:04:20)


...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

#37 Yesterday 16:59:53

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

That’s cool.  Thanks for the finds.  The method I shared with you is good enough for my use case.  Was just sharing that with you in case yall could use it.  GTK4 is a mess.

Offline

#38 Yesterday 19:40:34

greenjeans
Member
Registered: 2025-01-18
Posts: 267
Website

Re: [DONE] A couple of last-minute app substitutions for Carbon

cog wrote:

GTK4 is a mess.

You ain't justa whistlin' Dixie there pilgrim. Big ol' mess.

I am hopeful though that the gtk4-nocsd project can do some good though when it comes to theming.

Offline

#39 Today 06:23:48

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

If anyone feels like reading more about GTK4 and libadwaita, I found a few links:

https://wiki.archlinux.org/title/GTK
https://discuss.kde.org/t/gtk4-apps-don … eme/2969/3
https://discuss.kde.org/t/simple-hack-t … ma/29444/3
https://www.reddit.com/r/kde/comments/1 … gnomegtk4/

There is a patch for libadwaita to make it more amenable to theming, and someone has built it for Arch:
https://aur.archlinux.org/packages/liba … ut-adwaita
But there does not seem to be anything for Debian right now.

Finally I found this suggestion to symlink the css files from ~/.config/gtk-4.0/ to gtk.css and gtk-dark.css in whatever theme you want to apply:
https://github.com/orgs/linuxmint/discussions/927
On quick testing, this seems to work, and even light themes are displayed, ignoring the gsettings 'prefer dark' setting.
Of course it requires that the theme has a gtk4 directory with gtk.css and gtk-dark.css files, and also that those files are not one-liners importing from the gtk.gresource file, but full css files in their own right. So, for example, Greybird works but bunsen-yaru-sage-dark does not. Even that can be fixed, though, by running

gresource extract gtk.gresource /com/ubuntu/themes/bunsen-yaru-sage-dark/4.0/gtk.css >gtk.css

in the theme directory (and same for gtk-dark). With those full-fat css files the symlinks in ~/.config/gtk-4.0/  seem to work.


I'm just about to try making a short script to look for those css files in the chosen gtk theme, link to them if they exist, and then fall back on the envvar method (or maybe the xdg-desktop-portal-gtk method) if not.

I haven't yet tested whether the symlinked css files need xdg-desktop-portal-gtk to be installed or not.


...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

#40 Today 08:15:15

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

Re: [DONE] A couple of last-minute app substitutions for Carbon

This version of gtkset will successfully theme file-roller without the artifacts, and doesn't seem to need xdg-desktop-portal-gtk. No gtk-4.0/settings.ini either. It uses the symlinking method here: https://github.com/orgs/linuxmint/discussions/927

The big IF though is whether the chosen GTK theme supports GTK4, and also whether there are full css files. Symlinks to css files which import from gtk.gresource don't work. If BL were to use this we'd have to extract the css files from gtk.gresource for each of our themes. (I checked the themes I had installed on my VM and only the latest BL themes + Greybird had GTK4 directories.)

If the script can't find the css files to symlink to, then it falls back on passing the theme as an environment variable, which is less pretty. The fallback could be changed to just call the app as-is and allow xdg-desktop-portal-gtk along with the gsettings 'prefer-dark' to get a fixed dark but nicer-looking window.

#!/bin/bash
# script to launch GTK4 apps with the current GTK3 theme
# the chosen theme must support GTK4

app=$1
shift
hash "$app" || {
    echo "${0}: command $app not found" >&2
    exit 1
}

gtk_file=~/.config/gtk-3.0/settings.ini
[[ -r $gtk_file ]] || {
    echo "${0}: WARNING unable to read $gtk_file, no theming will be applied." >&2
    exec "$app" "$@"
    exit
}

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

target_dir="$HOME/.config/gtk-4.0"

homethemedir="$HOME/.local/share/themes"
systhemedir=/usr/share/themes
if [[ -d $homethemedir/$gtk3_theme/gtk-4.0 ]]
then
    source_dir=$homethemedir/$gtk3_theme/gtk-4.0
elif [[ -d $systhemedir/$gtk3_theme/gtk-4.0 ]]
then
    source_dir=$systhemedir/$gtk3_theme/gtk-4.0
else
    echo "${0}: cannot find theme $gtk3_theme gtk4 directory, using environment variable to set theme."
    GTK_THEME="$gtk3_theme" exec "$app" "$@"
fi

if [[ -r $source_dir/gtk.css && -r $source_dir/gtk-dark.css ]] && ! grep -q '@import url("resource:///.*gtk.css");' <(head "$source_dir/gtk.css") && ! grep -q '@import url("resource:///.*gtk-dark.css");' <(head "$source_dir/gtk-dark.css")
then
    ln -sf "$source_dir/gtk.css" "$target_dir/gtk.css"
    ln -sf "$source_dir/gtk-dark.css" "$target_dir/gtk-dark.css"
else
    echo "${0}: unable to link css files, using environment variable to set theme." >&2
    GTK_THEME="$gtk3_theme" exec "$app" "$@"
fi

exec "$app" "$@"

It probably still needs some checks and tests.

Last edited by johnraff (Today 09:28:17)


...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

Board footer

Powered by FluxBB