Skip to content

Instantly share code, notes, and snippets.

@dansimau
Created January 3, 2015 12:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dansimau/1fed917390f5a563baf2 to your computer and use it in GitHub Desktop.
Save dansimau/1fed917390f5a563baf2 to your computer and use it in GitHub Desktop.
Undo a Mac theme stuck in dark mode due to https://github.com/samturner/lights-out
from Foundation import CFPreferencesSetValue
from Foundation import CFNotificationCenterPostNotification
from Foundation import CFNotificationCenterGetDistributedCenter
from Foundation import kCFPreferencesAnyApplication
from Foundation import kCFPreferencesCurrentUser
from Foundation import kCFPreferencesCurrentHost
# Remove offending preference
CFPreferencesSetValue('AppleInterfaceStyle', None, kCFPreferencesAnyApplication,
kCFPreferencesCurrentUser, kCFPreferencesCurrentHost)
# Trigger UI to be updated
CFNotificationCenterPostNotification(CFNotificationCenterGetDistributedCenter(),
'AppleInterfaceThemeChangedNotification',
None, None, True);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment