darkman.nvim icon indicating copy to clipboard operation
darkman.nvim copied to clipboard

Allow configurable default

Open 4e554c4c opened this issue 8 months ago • 2 comments

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.

4e554c4c avatar Apr 06 '25 14:04 4e554c4c

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:

  1. As per the spec, any unknown values besides 0 should 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 of 3 seems to be used for the uninitialized state.
  2. 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.

gwuen avatar Apr 06 '25 23:04 gwuen

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

4e554c4c avatar Apr 07 '25 10:04 4e554c4c