Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tonyarnold/137216 to your computer and use it in GitHub Desktop.
Save tonyarnold/137216 to your computer and use it in GitHub Desktop.
+ (void)setSystemMenuTransparent:(BOOL)transparent {
CFPreferencesSetValue(CFSTR("AppleEnableMenuBarTransparency"), (CFBooleanRef)[NSNumber numberWithBool:transparent], kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
CFPreferencesSynchronize(kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"AppleMenuTransparencyChanged" object:nil];
}
+ (BOOL)systemMenuTransparent {
BOOL returnValue = NO;
CFPropertyListRef plr = CFPreferencesCopyValue(CFSTR("AppleEnableMenuBarTransparency"), kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
if (plr != NULL) {
returnValue = (BOOL)CFBooleanGetValue((CFBooleanRef)plr);
CFRelease(plr);
}
return returnValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment