Cannot actually query dark/light mode in script?

Have you read this topic?