Closed cassidyjames closed 4 years ago
Hi! I'm a non-elementaryOS user but asking here in the interest of cross-desktop compatibility (I ended up here through this thread).
I'm patching my system and different tools to automatically switch to a darker theme at sundown, and figuring out what each application supports, etc.
I'd love to see a cross-desktop API where applications of any desktop can figure out if they should use night mode right now or not (and possible get signalled if this should change). You guys are the first to implement an API to do this, and I think the design makes sense. I honestly see no reason not to adopt it elsewhere.
As it is right now, I would like to create a tiny service that just exposes the io.elementary.pantheon.AccountsService
D-Bus interface, but just exposes the PrefersColorScheme
property. This mimics what your elementary-specific service is doing (am I right so far?). My service would not really work on elementary, but that's not a problem, this is just for other environments.
I am correct in that this is a D-Bus interface, right? (the naming convention seems to be that).
Would it also make sense to expose a ColorSchemeChanged
signal for application to also listen to property changes?
Thanks!
@WhyNotHugo Hey I'm glad to hear you're interested in porting this to other desktops. You may find the discussion here relevant: https://github.com/elementary/settings-daemon/issues/16
AccountsService does expose this information over DBus yes, but for sandboxing purposes it sounds like it would be better to use a different namespace. The current proposal is to provide org.freedesktop.prefers-color-scheme
. So I would recommend you use that namespace for your interface and we'll follow shortly :)
If you wanted to add more discussion to that linked issue report that would be great since that's where we're currently tracking this change proposal
From https://dbus.freedesktop.org/doc/dbus-api-design.html:
It sounds like it is expected to be implemented as an enum on the client side and then just send the int over DBus. In this case we would use:
0
no preference1
prefer dark2
prefer light