Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

settings: Add color-scheme key #633

Merged
merged 2 commits into from
Sep 20, 2021
Merged

Conversation

alice-mkh
Copy link
Contributor

Specify a key for getting the system's preferred color scheme.

Fixes #629

Specify a key for getting the system's preferred color scheme.

Fixes flatpak#629
@TingPing
Copy link
Member

Looks fine to merge once implementations exist.

@alice-mkh
Copy link
Contributor Author

alice-mkh commented Sep 19, 2021

https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/merge_requests/12

Do we need an equivalent xdg-desktop-portal-gtk change? On one hand it's fairly GNOME-specific, but -gtk already has plenty of GNOME things in it. Since xdg-desktop-portal-gnome exists now, not sure what's the policy regarding that.

@alice-mkh
Copy link
Contributor Author

elementary implementation: elementary/settings-daemon#38

@TingPing TingPing merged commit d7a304a into flatpak:master Sep 20, 2021
@TingPing
Copy link
Member

I'll leave the -gtk question to @GeorgesStavracas

@GeorgesStavracas
Copy link
Member

Do we need an equivalent xdg-desktop-portal-gtk change?

I would say, yes.

@alice-mkh
Copy link
Contributor Author

I would say, yes.

Ok - flatpak/xdg-desktop-portal-gtk#354

TingPing pushed a commit to flatpak/xdg-desktop-portal-gtk that referenced this pull request Sep 21, 2021
kdesysadmin pushed a commit to KDE/xdg-desktop-portal-kde that referenced this pull request Sep 28, 2021
Implement flatpak/xdg-desktop-portal#633

Currently only maps schemes from the breeze family to light/dark and returns no preference for third-party schemes

A fancier solution for the future would be to try and guess whether a scheme is light or dark like the colors KCM does
kdesysadmin pushed a commit to KDE/xdg-desktop-portal-kde that referenced this pull request Sep 29, 2021
Implement flatpak/xdg-desktop-portal#633

Currently only maps schemes from the breeze family to light/dark and returns no preference for third-party schemes

A fancier solution for the future would be to try and guess whether a scheme is light or dark like the colors KCM does
@lilianmoraru
Copy link

@Exalm, @GeorgesStavracas, @TingPing
Could you please also add support for High Contrast?
Microsoft does it very nicely: https://support.microsoft.com/en-us/windows/use-high-contrast-mode-in-windows-10-fedc744c-90ac-69df-aed5-c8a90125e696 , allowing users that maybe have problems seeing a particular color to switch to a different one.
Here they describe the event that apps will receive and how to read the user's desired colors, in order to avoid hardcoding them: https://docs.microsoft.com/en-us/windows/win32/w8cookbook/high-contrast-mode#solution

@alice-mkh
Copy link
Contributor Author

We have it in GNOME, but I consider it a separate issue when it comes to having a standardized one - for example, elementary doesn't have it.

@lilianmoraru
Copy link

GNOME has a separate accessibility toggle with no dedicated D-Bus connection to listen on, for apps to handle it(and missing documentation).
It needs a more official/portable way of doing it(IMO). I thought that once you are here, this could be handled as well.

@alice-mkh
Copy link
Contributor Author

I mean until recently (still is in 41) it was a theme - not even a flag. One thing at a time :p

kdesysadmin pushed a commit to KDE/xdg-desktop-portal-kde that referenced this pull request Oct 16, 2021
Implement flatpak/xdg-desktop-portal#633

Currently only maps schemes from the breeze family to light/dark and returns no preference for third-party schemes

A fancier solution for the future would be to try and guess whether a scheme is light or dark like the colors KCM does
@WhyNotHugo
Copy link
Contributor

WhyNotHugo commented Jan 13, 2022

I'm trying to read this setting with non-flatpak'd apps (in my case, d-feet), but I get:

('g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: '
 'Portal operation not allowed: Unable to open /proc/147042/root (9)')

Are native applications supposed to use a different mechanism to retrieve this value from the portal?

@swick
Copy link
Contributor

swick commented Jan 13, 2022

IMO no, if it's not working for some reason that's a bug.

@alice-mkh
Copy link
Contributor Author

Screenshot from 2022-01-13 20-09-56

@rusty-snake
Copy link

rusty-snake commented Jan 13, 2022

Screenshot_2022-01-13_15-12-49-fs8

Fedora Linux 35; Workstation/GNOME; xdg-desktop-portal-gnome/xdg-desktop-portal-gtk; d-feet via dnf;

Works:

dbus-send --print-reply --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme'

/usr/bin/d-feet works too => it's firejail.

@WhyNotHugo
Copy link
Contributor

@rusty-snake Reported in #737

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.

Provide a standard dark style preference key in the settings portal
7 participants