How to poll day/night status from Night Colour KCM programmatically?

Because

  1. https://location.services.mozilla.com/

    As a developer you can directly use the service.

  2. MLS - API

    If you are not a Mozilla employee, to obtain an API key, please fill out this form.

  3. Request Form for MLS API Key

    Please note that we are NOT currently providing keys to … personal projects

I’d like to know whether kcmshell5 kcm_nightcolor exposes any method (dbus?) of getting whether the current time is day or not.

I’d like this because Plasma can’t currently automatically switch between Breeze’s Dark and Light themes depending upon whether the current time is day or night like Android and Windows 11 can. I suppose that I could check whether this preference has been enabled and then whether the night color is active, but that seems very hacky.

Thanks.

I think this is currently being worked on. Have a look at: Day and Night color scheme switching (#59) · Issues · Plasma / Plasma Workspace · GitLab

€: Shouldn’t this be in the Development Category?

2 Likes

#Development doesn’t support Q&A like #Help does.

Yeah, but I’d like to develop a simple script for this myself. It is, after all, a mere case of pulling the information from one place and, if a boolean value, running a one-liner to change the theme. I just don’t know how to discover dbus commands myself.

Check the source of this project:

That seems to be using DBUS and nightcolor

There is also (C++)

and (Python)

1 Like

Its github.com/adrium/knightadjuster#readme also mentions

which appears to be even more powerful.