Skip to content

Hacky check whether macOS is configured to use a Dark Mode appearance

License

Notifications You must be signed in to change notification settings

kornelski/is-dark-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Check whether the system is set to a Dark Mode style

This checks a global system default. It is intended for headless tools or programs that can't access their windows. It may not be accurate when specific screens or applications have a different theme set. If you control your GUI, please check window-specific properties instead (on macOS that is NSAppearance protocol).

On macOS this crate uses Core Foundation to read a AppleInterfaceStyle global setting, which is equivalent of:

defaults read -g AppleInterfaceStyle

On other platforms only None is returned. Please submit pull requests for more OSes!

About

Hacky check whether macOS is configured to use a Dark Mode appearance

Topics

Resources

License

Stars

Watchers

Forks

Languages