switch_theme.pyw
def switch_color_theme():
    """ Switches Windows 10 default app mode between light
        and dark theme by changing value of registry key
    """
    key = winreg.HKEY_CURRENT_USER
    sub_key = r'Software\Microsoft\Windows\CurrentVersion\Themes\Personalize'

    # Default app mode registry key: 0 - dark, 1 - light
    theme_key = winreg.OpenKey(key, sub_key, 0, winreg.KEY_ALL_ACCESS)
    theme_key_value = winreg.QueryValueEx(theme_key, 'AppsUseLightTheme')[0]

    # Switching key value: 0 <--> 1
    winreg.SetValueEx(
                  theme_key,
                  'AppsUseLightTheme',
                  0,
                  winreg.REG_DWORD,
                  switch_01(theme_key_value)
                  )

    winreg.CloseKey(theme_key)
 Switches Windows 10 default app mode between light
        and dark theme by changing value of registry key
    
Switches Windows 10 default app mode between light
and dark theme by changing value of registry key
Switches Windows 10 default app mode between light and dark theme by changing value of registry key
def switch_color_theme():
    key = winreg.HKEY_CURRENT_USER
    sub_key = r'Software\Microsoft\Windows\CurrentVersion\Themes\Personalize'
    theme_key = winreg.OpenKey(key, sub_key, 0, winreg.KEY_ALL_ACCESS)
    theme_key_value = winreg.QueryValueEx(theme_key, 'AppsUseLightTheme')[0]
    winreg.SetValueEx(
                  theme_key,
                  'AppsUseLightTheme',
                  0,
                  winreg.REG_DWORD,
                  switch_01(theme_key_value)
                  )
    winreg.CloseKey(theme_key)
def switch_color_theme ( ) : key = winreg . HKEY_CURRENT_USER sub_key = r'Software\Microsoft\Windows\CurrentVersion\Themes\Personalize' theme_key = winreg . OpenKey ( key , sub_key , 0 , winreg . KEY_ALL_ACCESS ) theme_key_value = winreg . QueryValueEx ( theme_key , 'AppsUseLightTheme' ) [ 0 ] winreg . SetValueEx ( theme_key , 'AppsUseLightTheme' , 0 , winreg . REG_DWORD , switch_01 ( theme_key_value ) ) winreg . CloseKey ( theme_key )
Switches Windows 10 default app mode between light
and dark theme by changing value of registry key
Switches Windows 10 default app mode between light and dark theme by changing value of registry key
""" Switches Windows 10 default app mode between light
        and dark theme by changing value of registry key
    """ # Default app mode registry key: 0 - dark, 1 - light # Switching key value: 0 <--> 1