I like switching between light and dark themes based on the time of day/system theme and because Unity lacks that functionality I implemented it myself:
Auto Dark Theme
Automatically sets the Unity editor theme based on the current time or system theme settings.
Supported operating systems for system-based switching:
Observing the registry seemed like the most straight-forward way. What are your concerns with this method? I’m only reading, not writing.
I suspect calling WinRT via P/Invoke does not work because Unity Editor is not UWP.
But maybe there is indeed a better method.
You should be able to use time-based switching on Linux, although I didn’t test this yet.
To my knowledge there is no unified way to detect system light/dark themes on all various desktop environments.