Skip to content

Instantly share code, notes, and snippets.

Last active May 14, 2021 08:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# Python3
# Double click this file to change app mode theme in Windows 10
# Dark theme is 0 and light theme is 1
import os
import subprocess
themecolour = int(os.popen("reg query HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme").read().rstrip()[-1])
changedtheme = str(int(not bool(themecolour)))
command = ['reg.exe', 'add', 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize',
'/v', 'AppsUseLightTheme', '/t', 'REG_DWORD', '/d', changedtheme, '/f']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment