You are not logged in.

#1 2025-04-10 20:40:06

EBADFD
Member
Registered: 2025-03-31
Posts: 11

[Solved] DBUS fails to return theme (here's some code from SDL/SDL3)

IDK how to format code. The code below is https://github.com/libsdl-org/SDL/blob/ … em_theme.c

I barely customized my current install of arch. I'm using xfce4. I'm certain SDL's code is correct but it can not tell when I changed the system theme.

An LLM suggested I need to run dbus.service and dbus-user-session.service. I'm sure it's hallucinating but I can say these services does not exist when I run the commands below. tumbler is installed (out of the box) and I have the dbus binaries below.
Let me know if you want any more information

dbus-binding-tool                   dbus-monitor
dbus-broker                         dbus-run-session
dbus-broker-launch                  dbus-send
dbus-cleanup-sockets                dbus-test-tool
dbus-daemon                         dbus-update-activation-environment
dbus-launch                         dbus-uuidgen

I assume these aren't real

> systemctl --user status dbus.service
> systemctl --user status dbus-user-session.service


From SDL

#define PORTAL_DESTINATION "org.freedesktop.portal.Desktop"
#define PORTAL_PATH "/org/freedesktop/portal/desktop"
#define PORTAL_INTERFACE "org.freedesktop.portal.Settings"
#define PORTAL_METHOD "Read"

#define SIGNAL_INTERFACE "org.freedesktop.portal.Settings"
#define SIGNAL_NAMESPACE "org.freedesktop.appearance"
#define SIGNAL_NAME "SettingChanged"
#define SIGNAL_KEY "color-scheme"

"type='signal', interface='"SIGNAL_INTERFACE"',"
"member='"SIGNAL_NAME"', arg0='"SIGNAL_NAMESPACE"',"
"arg1='"SIGNAL_KEY"'", NULL);

Last edited by EBADFD (2025-04-22 23:23:44)

Offline

#2 2025-04-16 03:34:10

EBADFD
Member
Registered: 2025-03-31
Posts: 11

Re: [Solved] DBUS fails to return theme (here's some code from SDL/SDL3)

I'm still interested in solving this

Offline

#3 2025-04-16 07:02:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,317

Re: [Solved] DBUS fails to return theme (here's some code from SDL/SDL3)

An LLM suggested I …

… glue cheese to a pizza. So there's that.

https://en.wikipedia.org/wiki/XY_problem - it's not even clear what you're trying to achive, SDL is

A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard

The code you linked queries https://wiki.archlinux.org/title/XDG_Desktop_Portal for a color scheme, whether any SDL client uses that is a different matter.

Please use [code][/code] tags. Edit your post in this regard.
(It's btw. documented below the input textbox)

Offline

#4 2025-04-17 03:19:02

EBADFD
Member
Registered: 2025-03-31
Posts: 11

Re: [Solved] DBUS fails to return theme (here's some code from SDL/SDL3)

> it's not even clear what you're trying to achive

I'll try again. I'm writing code and using the function SDL_GetSystemTheme from sdl3 to get the theme https://wiki.libsdl.org/SDL3/SDL_GetSystemTheme
The code in my previous post is what that function uses on linux to get the theme. I seen that code work on other installs but it's not working on my arch install (I get unknown as the theme, its an enum). I'd like to know what I can configure on my side so my app and other apps using SDL or querying the theme in the same way can see what theme my system is set to

> The code you linked queries https://wiki.archlinux.org/title/XDG_Desktop_Portal for a color scheme

Yes. It's failing on my install and google seaches/llms told me to eat glue pizza. So I'm posting here for less sticky ideas

If it helps I change the theme by running the below

xfconf-query -c xsettings -p /Net/ThemeName -s "Adwaita"
xfconf-query -c xsettings -p /Net/ThemeName -s "Adwaita-dark"

Last edited by EBADFD (2025-04-17 05:18:14)

Offline

#5 2025-04-17 07:51:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,317

Re: [Solved] DBUS fails to return theme (here's some code from SDL/SDL3)

Sorry, I was under the impression you were maybe trying to apply some style you saw on r/unixporn (happens wink

So let's see what the session looks like, your session bus is ok, what portal instance(s) are running and installed:

loginctl session-status
echo $DBUS_SESSION_BUS_ADDRESS
ps aux | grep -i xdg
pacman -Qs portal

Offline

#6 2025-04-18 04:56:39

EBADFD
Member
Registered: 2025-03-31
Posts: 11

Re: [Solved] DBUS fails to return theme (here's some code from SDL/SDL3)

> style you saw on r/unixporn

harhar

I think I see the problem. No portal is installed? "pacman -Qs portal" gives me nothing. Do you recommend any? Would "extra/xdg-desktop-portal-xapp" be best for xfce4? Answer to your commands below

State: active
 Leader: 1654 (lightdm)
   Seat: seat0; vc7
Display: :0
 Remote: no
Service: lightdm
   Type: x11
  Class: user
Desktop: xfce
   Idle: no
   Unit: session-2.scope
         ├─ 1654 lightdm --session-child 13 20
         ├─ 1694 xfce4-session
         ├─ 1771 /usr/bin/ssh-agent -s
         ├─ 1781 xfwm4
         ├─ 1796 xfsettingsd
         ├─ 1807 xfce4-panel
         ├─ 1812 Thunar --daemon
         ├─ 1817 xfdesktop
         ...
         ├─ 1848 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
         ├─ 1849 xfce4-power-manager
         ├─ 1852 xfce4-screensaver


$ echo $DBUS_SESSION_BUS_ADDRESS
unix:path=/run/user/1000/bus

$ ps aux | grep -i xdg
userEBADFD          44071  0.0  0.0   6704  4224 pts/0    S+   00:52   0:00 grep --color=auto -i xdg

Last edited by EBADFD (2025-04-18 04:58:01)

Offline

#7 2025-04-18 07:14:46

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,317

Re: [Solved] DBUS fails to return theme (here's some code from SDL/SDL3)

Would "extra/xdg-desktop-portal-xapp" be best for xfce4?

That's rather for cinnamon, but you can certainly try if it doesn't add too many useless dependencies.
The generaic failsafe would be https://archlinux.org/packages/extra/x8 … ortal-gtk/

Offline

#8 2025-04-19 20:40:11

EBADFD
Member
Registered: 2025-03-31
Posts: 11

Re: [Solved] DBUS fails to return theme (here's some code from SDL/SDL3)

seth wrote:

Would "extra/xdg-desktop-portal-xapp" be best for xfce4?

That's rather for cinnamon, but you can certainly try if it doesn't add too many useless dependencies.
The generaic failsafe would be https://archlinux.org/packages/extra/x8 … ortal-gtk/

I tried installing 'xdg-desktop-portal-gtk', rebooting and running my code. It still reports unknown but I'll see if I can figure this out myself next week. Here's the output from the above commands again

loginctl session-status
echo $DBUS_SESSION_BUS_ADDRESS
ps aux | grep -i xdg
pacman -Qs portal

  State: active
 Leader: 1653 (lightdm)
   Seat: seat0; vc7
Display: :0
 Remote: no
Service: lightdm
   Type: x11
  Class: user
Desktop: xfce
   Idle: no
   Unit: session-2.scope
         ├─1653 lightdm --session-child 13 20
         ├─1682 xfce4-session
         ├─1777 /usr/bin/ssh-agent -s
         ├─1787 xfwm4
         ├─1807 xfsettingsd
         ├─1817 xfce4-panel
         ├─1822 Thunar --daemon
         ├─1828 xfdesktop
         ├─1832 /usr/lib/xfce4/panel/wrapper-2.0 /usr/lib/xfce4/panel/plugins/libwhiskermenu.so 11 16777223 whiskermenu "Whisker Menu" "Show a menu to easily access installed applications"
         ├─1836 /usr/lib/xfce4/panel/wrapper-2.0 /usr/lib/xfce4/panel/plugins/libsystray.so 6 16777224 systray "Status Tray Plugin" "Provides status notifier items (application indicators) a>
         ├─1837 /usr/lib/xfce4/panel/wrapper-2.0 /usr/lib/xfce4/panel/plugins/libclipman.so 12 16777225 xfce4-clipman-plugin Clipman "Clipboard manager"
         ├─1838 /usr/lib/xfce4/panel/wrapper-2.0 /usr/lib/xfce4/panel/plugins/libpulseaudio-plugin.so 1 16777226 pulseaudio "PulseAudio Plugin" "Adjust the audio volume of the PulseAudio sou>
         ├─1849 /usr/lib/xfce4/panel/wrapper-2.0 /usr/lib/xfce4/panel/plugins/libactions.so 10 16777227 actions "Action Buttons" "Log out, lock or other system actions"
         ├─1853 nm-applet
         ├─1854 xcape -e Super_L Alt_L F1
         ├─1856 unclutter
         ├─1858 /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
         ├─1859 xfce4-power-manager
         ├─1862 xfce4-screensaver
	 ...

$ echo $DBUS_SESSION_BUS_ADDRESS
unix:path=/run/user/1000/bus

$ ps aux | grep -i xdg
userEBADFD           2083  0.0  0.0 621428 16316 ?        Ssl  16:32   0:00 /usr/lib/xdg-desktop-portal
userEBADFD           2095  0.0  0.0 305772  7224 ?        Ssl  16:32   0:00 /usr/lib/xdg-permission-store
userEBADFD           2121  0.4  0.1 797032 50280 ?        Ssl  16:32   0:00 /usr/lib/xdg-desktop-portal-gtk
userEBADFD           3309  0.0  0.0   6704  4364 pts/0    S+   16:35   0:00 grep --color=auto -i xdg


$ pacman -Qs portal
local/xdg-desktop-portal 1.20.0-2
    Desktop integration portals for sandboxed apps
local/xdg-desktop-portal-gtk 1.15.3-1
    A backend implementation for xdg-desktop-portal using GTK

Offline

#9 2025-04-19 23:26:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,317

Re: [Solved] DBUS fails to return theme (here's some code from SDL/SDL3)

I suppose xfce simdply doesn't set any preference, https://wiki.archlinux.org/title/Dark_m … #gsettings
xdg-desktop-portal-xapp doesn't seem to read anythign beyond gsettings either: https://github.com/linuxmint/xdg-deskto … ngs.c#L116

Offline

#10 2025-04-22 23:23:27

EBADFD
Member
Registered: 2025-03-31
Posts: 11

Re: [Solved] DBUS fails to return theme (here's some code from SDL/SDL3)

It's working now and I'm not sure what I did, because I could have sworn I restarted (or at least logged out) when I tried things in the past. Here's what's installed

$ pacman -Q | grep portal
xdg-desktop-portal
xdg-desktop-portal-gtk

I had an issue in the past where gnome-calculator wasn't using dark, now it does. Problem solved

Offline

Board footer

Powered by FluxBB