I have objective C code to detect dark mode to change the status bar:
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(darkModeChanged:) name:@"AppleInterfaceThemeChangedNotification" object:nil];
Similarly, how can we do the same in python?
Try these following lines wherever you want to detect the mode (dark mode or light mode).
center = NSDistributedNotificationCenter.defaultCenter()
center.addObserver_selector_name_object_(self,"enableDarkMode",'AppleInterfaceThemeChangedNotification',None)