Allow configurable default
In #6, we set NO_PREFERENCE as an alias for light mode. This may not be desired, if you want no preference to have a semantic meaning as the default (for xdg-desktop-portals where no-preference is semantically meaningful, like with darkman).
For backwards compatibility, we should allow a default key, which defaults to light, and use it to determine the mode when NO_PREFERENCE is returned from the desktop portal.
I must admit, I had not really thought about "no preference" being a meaningful setting to some users. I would just like two add two things to the consideration:
- As per the spec, any unknown values besides
0should also be treated as no preference. This is not urgent, as I haven't seen an example of a non-standard value being used, but it would be a good precaution. I believe this would require a change in the setup logic, since right now a value of3seems to be used for the uninitialized state. - I'm not sure if this is part of your proposal, but in any case this should not become a general fallback option. I'm not opposed to having a configurable fallback in case getting the current preference over dbus fails. However, in the case of GNOME, it would force users to choose between having a functioning plugin (i.e., "no preference" = light) and the fallback they actually prefer.
Thank you!
PS: I would love helping with the implementation, but I have no experience with Go. Maybe I'll check back in if this is still an open issue in a few weeks and I have some time on my hands.
I agree with both points :) The second sentence in my issue I think covers the second point. We'd add a key that defaults to light so it should work by default for Gnome/Elementary users