Skip to content

Read dark-mode setting from the desktop portal#6

Open
TingPing wants to merge 1 commit into
mainfrom
pgriffis/dark-mode
Open

Read dark-mode setting from the desktop portal#6
TingPing wants to merge 1 commit into
mainfrom
pgriffis/dark-mode

Conversation

@TingPing
Copy link
Copy Markdown
Member

@TingPing TingPing commented Jun 3, 2026

There are numerous ways to make a GTK theme dark

The GtkSettings value is deprecated: https://docs.gtk.org/gtk4/property.Settings.gtk-application-prefer-dark-theme.html

The GSettings value isn't deprecated but was never a documented standard outside of GNOME and has the downside of not being accurate inside of any sandbox.

The portal setting is a standardized value that multiple desktops set.

This was problematic for the wig project which uses libadwaita, so the platform and application can be completely out of sync regarding dark mode. libadwaita also respects the portal value.

libportal was used for convenience, but it's just some basic dbus usage if that's preferred.

There are numerous ways to make a GTK theme dark

The GtkSettings value is deprecated: https://docs.gtk.org/gtk4/property.Settings.gtk-application-prefer-dark-theme.html

The GSettings value isn't deprecated but was never a documented standard
outside of GNOME and has the downside of not being accurate inside of any sandbox.

The portal setting is a standardized value that multiple desktops set.

This was problematic for the `wig` project which uses libadwaita,
so the platform and application can be completely out of sync regarding
dark mode. libadwaita also respects the portal value.

libportal was used for convenience, but it's just some basic dbus
usage if that's preferred.
@carlosgcampos
Copy link
Copy Markdown
Collaborator

I prefer not to add a dependency just for a dbus call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants