🐍 Python 3.10+
Check "Enable Dark Mode" Status (Python)
Reads the registry value behind the "Enable Dark Mode" tweak via winreg to confirm whether it's applied.
check_dark_mode_status.py
#!/usr/bin/env python3
"""
check_dark_mode_status.py
Checks whether "Enable Dark Mode" is currently applied.
Usage:
python check_dark_mode_status.py
"""
import winreg
def main() -> None:
try:
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize")
value, _ = winreg.QueryValueEx(key, "AppsUseLightTheme")
winreg.CloseKey(key)
print(f"Current value of 'AppsUseLightTheme': {value}")
except FileNotFoundError:
print("'AppsUseLightTheme' is not set (using the Windows default).")
if __name__ == "__main__":
main()