Repository: leonspok/Menubar-Toggle Branch: master Commit: 26360c146628 Files: 24 Total size: 35.5 KB Directory structure: gitextract_izodftd0/ ├── .gitignore ├── DMG/ │ ├── AppIcon.icns │ └── manifest.json ├── LICENSE ├── Menubar Toggle/ │ ├── Menubar Toggle/ │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets/ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── menubarLogoDarkThemeEnabled.imageset/ │ │ │ │ └── Contents.json │ │ │ └── menubarLogoLightThemeEnabled.imageset/ │ │ │ └── Contents.json │ │ ├── Base.lproj/ │ │ │ └── MainMenu.xib │ │ ├── Info.plist │ │ ├── LPWallpaperObserver.h │ │ ├── LPWallpaperObserver.m │ │ ├── Menubar Toggle.entitlements │ │ ├── NSImage+Luminance.h │ │ ├── NSImage+Luminance.m │ │ ├── change_theme.txt │ │ ├── get_theme.txt │ │ └── main.m │ └── Menubar Toggle.xcodeproj/ │ ├── project.pbxproj │ └── project.xcworkspace/ │ └── contents.xcworkspacedata ├── README.md └── toggle.sketch ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Xcode # build/ *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata *.xccheckout *.moved-aside DerivedData *.hmap *.ipa *.xcuserstate # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control # #Pods/ ================================================ FILE: DMG/manifest.json ================================================ { "title": "Menubar Toggle", "icon": "AppIcon.icns", "background": "background.png", "icon-size": 80, "contents": [ { "x": 304, "y": 140, "type": "link", "path": "/Applications" }, { "x": 100, "y": 140, "type": "file", "path": "Menubar Toggle.app" } ] } ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2015 Savelev Igor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Menubar Toggle/Menubar Toggle/AppDelegate.h ================================================ // // AppDelegate.h // Menubar Toggle // // Created by Игорь Савельев on 27/09/15. // Copyright © 2015 Leonspok. All rights reserved. // #import @interface AppDelegate : NSObject @end ================================================ FILE: Menubar Toggle/Menubar Toggle/AppDelegate.m ================================================ // // AppDelegate.m // Menubar Toggle // // Created by Игорь Савельев on 27/09/15. // Copyright © 2015 Leonspok. All rights reserved. // #import "AppDelegate.h" #import "LPWallpaperObserver.h" @interface AppDelegate () @property (strong, nonatomic) NSStatusItem *statusItem; @property (weak) IBOutlet NSMenu *menu; @property (weak) IBOutlet NSMenuItem *enabledItem; @property (weak) IBOutlet NSMenuItem *infoItem; @property (weak) IBOutlet NSMenuItem *startAtLoginItem; @end @implementation AppDelegate - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [self enableStatusItem]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setMenuBarDarkThemeLogo) name:kThemeChangedToDarkNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setMenuBarLightThemeLogo) name:kThemeChangedToLightNotification object:nil]; } - (void)enableStatusItem { [self hideIcon:self]; _statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]; _statusItem.title = @""; _statusItem.toolTip = @"Menubar Toggle"; _statusItem.menu = self.menu; _statusItem.menu.autoenablesItems = NO; if ([[LPWallpaperObserver sharedObserver] isDarkModeEnabled]) { [self setMenuBarDarkThemeLogo]; } else { [self setMenuBarLightThemeLogo]; } [self.infoItem setTitle:[NSString stringWithFormat:@"ver %@ (Build %@)", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]]; [self.enabledItem setState:[LPWallpaperObserver sharedObserver].autoSwithOSXTheme? NSOnState : NSOffState]; [self.startAtLoginItem setState:[self willStartAtLogin]? NSOnState : NSOffState]; } - (void)applicationWillBecomeActive:(NSNotification *)notification { [self enableStatusItem]; } - (void)applicationWillTerminate:(NSNotification *)aNotification { // Insert code here to tear down your application } - (void)setMenuBarDarkThemeLogo { NSImage *menuBarLogo = [NSImage imageNamed:@"menubarLogoDarkThemeEnabled"]; [menuBarLogo setTemplate:YES]; _statusItem.image = menuBarLogo; } - (void)setMenuBarLightThemeLogo { NSImage *menuBarLogo = [NSImage imageNamed:@"menubarLogoLightThemeEnabled"]; [menuBarLogo setTemplate:YES]; _statusItem.image = menuBarLogo; } - (IBAction)toggleEnabled:(id)sender { [[LPWallpaperObserver sharedObserver] setAutoSwithOSXTheme:![LPWallpaperObserver sharedObserver].autoSwithOSXTheme]; [self.enabledItem setState:[LPWallpaperObserver sharedObserver].autoSwithOSXTheme? NSOnState : NSOffState]; } - (BOOL)willStartAtLogin { BOOL foundIt = NO; LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL); if (loginItems) { UInt32 seed = 0U; NSArray *currentLoginItems = (__bridge NSArray *)(LSSharedFileListCopySnapshot(loginItems, &seed)); for (id itemObject in currentLoginItems) { LSSharedFileListItemRef item = (__bridge LSSharedFileListItemRef)itemObject; UInt32 resolutionFlags = kLSSharedFileListNoUserInteraction | kLSSharedFileListDoNotMountVolumes; NSURL *URL = (__bridge NSURL *)(LSSharedFileListItemCopyResolvedURL(item, resolutionFlags, NULL)); foundIt = [URL isEqual:[[NSBundle mainBundle] bundleURL]]; if (foundIt) { break; } } CFRelease(loginItems); } return foundIt; } - (IBAction)toggleStartAtLogin:(id)sender { LSSharedFileListItemRef existingItem = NULL; LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL); if (loginItems) { UInt32 seed = 0U; NSArray *currentLoginItems = (__bridge NSArray *)(LSSharedFileListCopySnapshot(loginItems, &seed)); for (id itemObject in currentLoginItems) { LSSharedFileListItemRef item = (__bridge LSSharedFileListItemRef)itemObject; UInt32 resolutionFlags = kLSSharedFileListNoUserInteraction | kLSSharedFileListDoNotMountVolumes; NSURL *URL = (__bridge NSURL *)(LSSharedFileListItemCopyResolvedURL(item, resolutionFlags, NULL)); BOOL foundIt = [URL isEqual:[[NSBundle mainBundle] bundleURL]]; if (foundIt) { existingItem = item; break; } } if (existingItem != NULL) { LSSharedFileListItemRemove(loginItems, existingItem); } else { LSSharedFileListInsertItemURL(loginItems, kLSSharedFileListItemBeforeFirst, NULL, NULL, (__bridge CFURLRef)[[NSBundle mainBundle] bundleURL], NULL, NULL); } CFRelease(loginItems); } [self.startAtLoginItem setState:[self willStartAtLogin]? NSOnState : NSOffState]; } - (IBAction)hideIcon:(id)sender { if (!_statusItem) { return; } [[NSStatusBar systemStatusBar] removeStatusItem:_statusItem]; _statusItem = nil; } @end ================================================ FILE: Menubar Toggle/Menubar Toggle/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "size" : "16x16", "idiom" : "mac", "filename" : "1024@16pt.png", "scale" : "1x" }, { "size" : "16x16", "idiom" : "mac", "filename" : "1024@16pt@2x.png", "scale" : "2x" }, { "size" : "32x32", "idiom" : "mac", "filename" : "1024@32pt.png", "scale" : "1x" }, { "size" : "32x32", "idiom" : "mac", "filename" : "1024@32pt@2x.png", "scale" : "2x" }, { "size" : "128x128", "idiom" : "mac", "filename" : "1024@128pt.png", "scale" : "1x" }, { "size" : "128x128", "idiom" : "mac", "filename" : "1024@128pt@2x.png", "scale" : "2x" }, { "size" : "256x256", "idiom" : "mac", "filename" : "1024@256pt.png", "scale" : "1x" }, { "size" : "256x256", "idiom" : "mac", "filename" : "1024@256pt@2x.png", "scale" : "2x" }, { "size" : "512x512", "idiom" : "mac", "filename" : "1024@512pt.png", "scale" : "1x" }, { "size" : "512x512", "idiom" : "mac", "filename" : "1024@512pt@2x.png", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Menubar Toggle/Menubar Toggle/Assets.xcassets/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Menubar Toggle/Menubar Toggle/Assets.xcassets/menubarLogoDarkThemeEnabled.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "filename" : "menubarLogoDarkThemeEnabled.pdf" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Menubar Toggle/Menubar Toggle/Assets.xcassets/menubarLogoLightThemeEnabled.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "filename" : "menubarLogoLightThemeEnabled.pdf" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: Menubar Toggle/Menubar Toggle/Base.lproj/MainMenu.xib ================================================ ================================================ FILE: Menubar Toggle/Menubar Toggle/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.1 CFBundleSignature ???? CFBundleVersion 1100 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) LSUIElement NSHumanReadableCopyright Copyright © 2015 Leonspok. All rights reserved. NSMainNibFile MainMenu NSPrincipalClass NSApplication ================================================ FILE: Menubar Toggle/Menubar Toggle/LPWallpaperObserver.h ================================================ // // LPWallpaperObserver.h // Menubar Toggle // // Created by Игорь Савельев on 27/09/15. // Copyright © 2015 Leonspok. All rights reserved. // #import extern NSString *const kThemeChangedToDarkNotification; extern NSString *const kThemeChangedToLightNotification; @interface LPWallpaperObserver : NSObject @property (nonatomic, assign) BOOL autoSwithOSXTheme; @property (nonatomic, assign, readonly, getter=isDarkModeEnabled) BOOL darkModeEnabled; + (instancetype)sharedObserver; - (void)setSuitableThemeIfNeeded; - (void)resetTheme; @end ================================================ FILE: Menubar Toggle/Menubar Toggle/LPWallpaperObserver.m ================================================ // // LPWallpaperObserver.m // Menubar Toggle // // Created by Игорь Савельев on 27/09/15. // Copyright © 2015 Leonspok. All rights reserved. // #import "LPWallpaperObserver.h" #import "NSImage+Luminance.h" @import AppKit; NSString *const kThemeChangedToDarkNotification = @"ThemeChangedToDarkNotification"; NSString *const kThemeChangedToLightNotification = @"ThemeChangedToLightNotification"; static NSString *const kAutoSwithOSXThemeKey = @"autoSwithOSXTheme"; static NSString *const kImagesLuminanceInfoPlistFileName = @"imagesLuminance.plist"; @implementation LPWallpaperObserver { NSString *applicationSupportFolder; NSTimer *observingTimer; } + (instancetype)sharedObserver { static LPWallpaperObserver *__sharedObserver = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ __sharedObserver = [[LPWallpaperObserver alloc] init]; }); return __sharedObserver; } - (id)init { self = [super init]; if (self) { [self updatePaths]; if (self.autoSwithOSXTheme) { [self setAutoSwithOSXTheme:self.autoSwithOSXTheme]; } } return self; } - (void)updatePaths { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); applicationSupportFolder = [[paths firstObject] stringByAppendingPathComponent:@"Menubar Toggle"]; if (![[NSFileManager defaultManager] fileExistsAtPath:applicationSupportFolder]) { [[NSFileManager defaultManager] createDirectoryAtPath:applicationSupportFolder withIntermediateDirectories:YES attributes:nil error:nil]; } } #pragma mark Getters and Setters - (BOOL)autoSwithOSXTheme { if (NSAppKitVersionNumber < NSAppKitVersionNumber10_10) { return NO; } return [[NSUserDefaults standardUserDefaults] boolForKey:kAutoSwithOSXThemeKey]; } - (void)setAutoSwithOSXTheme:(BOOL)autoSwithOSXTheme { if (NSAppKitVersionNumber < NSAppKitVersionNumber10_10) { autoSwithOSXTheme = NO; } [[NSUserDefaults standardUserDefaults] setBool:autoSwithOSXTheme forKey:kAutoSwithOSXThemeKey]; [[NSUserDefaults standardUserDefaults] synchronize]; if (!autoSwithOSXTheme) { [self resetTheme]; [observingTimer invalidate]; observingTimer = nil; } else { [self setSuitableThemeIfNeeded]; dispatch_async(dispatch_get_main_queue(), ^{ observingTimer = [NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(setSuitableThemeIfNeeded) userInfo:nil repeats:YES]; }); } } - (BOOL)isDarkModeEnabled { NSAppleScript *script = [[NSAppleScript alloc] initWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"get_theme" withExtension:@"txt"] error:nil]; NSAppleEventDescriptor *dsc = [script executeAndReturnError:nil]; return dsc.booleanValue; } - (void)resetTheme { [self setDarkTheme:NO]; } #pragma mark Wallpapers Observing - (BOOL)themeShouldBeDark { CGFloat averageLuminance = 0.0f; for (NSScreen *screen in [NSScreen screens]) { NSString *path = [[[NSWorkspace sharedWorkspace] desktopImageURLForScreen:screen] path]; averageLuminance += [self luminanceForImageWithPath:path]; } if ([NSScreen screens].count > 0) { averageLuminance = averageLuminance/[NSScreen screens].count; } return averageLuminance < 0.375; } - (void)setDarkTheme:(BOOL)dark { NSString *scriptSource = [[NSString alloc] initWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"change_theme" withExtension:@"txt"] encoding:NSUTF8StringEncoding error:nil]; scriptSource = [scriptSource stringByReplacingOccurrencesOfString:@"" withString:(dark? @"true" : @"false")]; NSAppleScript *script = [[NSAppleScript alloc] initWithSource:scriptSource]; [script executeAndReturnError:nil]; dispatch_async(dispatch_get_main_queue(), ^{ if (dark) { [[NSNotificationCenter defaultCenter] postNotificationName:kThemeChangedToDarkNotification object:nil]; } else { [[NSNotificationCenter defaultCenter] postNotificationName:kThemeChangedToLightNotification object:nil]; } }); } - (void)setSuitableThemeIfNeeded { if (NSAppKitVersionNumber < NSAppKitVersionNumber10_10) { return; } dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ BOOL shouldBeDark = [self themeShouldBeDark]; BOOL darkModeEnabled = [self isDarkModeEnabled]; if (shouldBeDark != darkModeEnabled) { dispatch_async(dispatch_get_main_queue(), ^{ [self setDarkTheme:shouldBeDark]; }); } }); } #pragma mark Images Managing - (CGFloat)luminanceForImageWithPath:(NSString *)path { NSString *plistFilePath = [applicationSupportFolder stringByAppendingPathComponent:kImagesLuminanceInfoPlistFileName]; NSMutableDictionary *info = [[NSMutableDictionary alloc] initWithContentsOfFile:plistFilePath]; if ([info objectForKey:path]) { return [[info objectForKey:path] doubleValue]; } if (!info) { info = [NSMutableDictionary dictionary]; } NSImage *image = [[NSImage alloc] initWithContentsOfFile:path]; if (image) { CGFloat luminance = image.luminance; [info setObject:@(luminance) forKey:path]; [info writeToFile:plistFilePath atomically:YES]; return luminance; } else { return 0.5f; } } @end ================================================ FILE: Menubar Toggle/Menubar Toggle/Menubar Toggle.entitlements ================================================ ================================================ FILE: Menubar Toggle/Menubar Toggle/NSImage+Luminance.h ================================================ // // NSImage+Luminance.h // Unsplash Wallpaper // // Created by Игорь Савельев on 06/06/15. // Copyright (c) 2015 Leonspok. All rights reserved. // #import @interface NSImage (Luminance) @property (nonatomic, readonly) CGFloat luminance; @end ================================================ FILE: Menubar Toggle/Menubar Toggle/NSImage+Luminance.m ================================================ // // NSImage+Luminance.m // Unsplash Wallpaper // // Created by Игорь Савельев on 06/06/15. // Copyright (c) 2015 Leonspok. All rights reserved. // #import "NSImage+Luminance.h" #import static NSString *const kCalculatedLuminanceKey = @"CALCULATED LUMINANCE"; @implementation NSImage (Luminance) - (NSBitmapImageRep *)bitmapImageRepresentation { int width = [self size].width; int height = [self size].height; if(width < 1 || height < 1) { return nil; } NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:width pixelsHigh:height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:(width * 4) bitsPerPixel:32]; NSGraphicsContext *ctx = [NSGraphicsContext graphicsContextWithBitmapImageRep:rep]; [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:ctx]; [self drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0]; [ctx flushGraphics]; [NSGraphicsContext restoreGraphicsState]; return rep; } - (CGFloat)luminance { NSNumber *lum = objc_getAssociatedObject(self, &kCalculatedLuminanceKey); if (lum) { return [lum doubleValue]; } NSBitmapImageRep *rep = [self bitmapImageRepresentation]; int width = [self size].width; int height = [self size].height; CGFloat totalLuminance = 0; CGFloat r; CGFloat g; CGFloat b; NSColor *color; NSInteger n = 0; for (NSInteger i = 0; i < height; i+=10) { for (NSInteger j = 0; j < width; j+=10) { color = [rep colorAtX:j y:i]; [color getRed:&r green:&g blue:&b alpha:NULL]; CGFloat luminance = (0.299*r + 0.587*g + 0.114*b); totalLuminance += luminance; n++; } } CGFloat averageLuminance = totalLuminance/n; objc_setAssociatedObject(self, &kCalculatedLuminanceKey, @(averageLuminance), OBJC_ASSOCIATION_RETAIN); return averageLuminance; } @end ================================================ FILE: Menubar Toggle/Menubar Toggle/change_theme.txt ================================================ tell application "System Events" tell appearance preferences to set dark mode to end tell ================================================ FILE: Menubar Toggle/Menubar Toggle/get_theme.txt ================================================ tell application "System Events" tell appearance preferences to get dark mode end tell ================================================ FILE: Menubar Toggle/Menubar Toggle/main.m ================================================ // // main.m // Menubar Toggle // // Created by Игорь Савельев on 27/09/15. // Copyright © 2015 Leonspok. All rights reserved. // #import int main(int argc, const char * argv[]) { return NSApplicationMain(argc, argv); } ================================================ FILE: Menubar Toggle/Menubar Toggle.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ E39CF8221BB805CE0036A8E8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E39CF8211BB805CE0036A8E8 /* AppDelegate.m */; }; E39CF8251BB805CE0036A8E8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E39CF8241BB805CE0036A8E8 /* main.m */; }; E39CF8271BB805CE0036A8E8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E39CF8261BB805CE0036A8E8 /* Assets.xcassets */; }; E39CF82A1BB805CE0036A8E8 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = E39CF8281BB805CE0036A8E8 /* MainMenu.xib */; }; E39CF8361BB826B60036A8E8 /* NSImage+Luminance.m in Sources */ = {isa = PBXBuildFile; fileRef = E39CF8351BB826B60036A8E8 /* NSImage+Luminance.m */; }; E39CF8391BB82B3E0036A8E8 /* LPWallpaperObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = E39CF8381BB82B3E0036A8E8 /* LPWallpaperObserver.m */; }; E3CBFB521E11224B004D51A6 /* change_theme.txt in Resources */ = {isa = PBXBuildFile; fileRef = E3CBFB511E11224B004D51A6 /* change_theme.txt */; }; E3CBFB541E11227D004D51A6 /* get_theme.txt in Resources */ = {isa = PBXBuildFile; fileRef = E3CBFB531E11227D004D51A6 /* get_theme.txt */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ E39CF81D1BB805CE0036A8E8 /* Menubar Toggle.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Menubar Toggle.app"; sourceTree = BUILT_PRODUCTS_DIR; }; E39CF8201BB805CE0036A8E8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; E39CF8211BB805CE0036A8E8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; E39CF8241BB805CE0036A8E8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; E39CF8261BB805CE0036A8E8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; E39CF8291BB805CE0036A8E8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; E39CF82B1BB805CE0036A8E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; E39CF8341BB826B60036A8E8 /* NSImage+Luminance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSImage+Luminance.h"; sourceTree = ""; }; E39CF8351BB826B60036A8E8 /* NSImage+Luminance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSImage+Luminance.m"; sourceTree = ""; }; E39CF8371BB82B3E0036A8E8 /* LPWallpaperObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LPWallpaperObserver.h; sourceTree = ""; }; E39CF8381BB82B3E0036A8E8 /* LPWallpaperObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LPWallpaperObserver.m; sourceTree = ""; }; E39CF83C1BB834E10036A8E8 /* Menubar Toggle.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Menubar Toggle.entitlements"; sourceTree = ""; }; E3CBFB511E11224B004D51A6 /* change_theme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = change_theme.txt; sourceTree = ""; }; E3CBFB531E11227D004D51A6 /* get_theme.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = get_theme.txt; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ E39CF81A1BB805CE0036A8E8 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ E39CF8141BB805CE0036A8E8 = { isa = PBXGroup; children = ( E39CF81F1BB805CE0036A8E8 /* Menubar Toggle */, E39CF81E1BB805CE0036A8E8 /* Products */, ); sourceTree = ""; }; E39CF81E1BB805CE0036A8E8 /* Products */ = { isa = PBXGroup; children = ( E39CF81D1BB805CE0036A8E8 /* Menubar Toggle.app */, ); name = Products; sourceTree = ""; }; E39CF81F1BB805CE0036A8E8 /* Menubar Toggle */ = { isa = PBXGroup; children = ( E39CF83C1BB834E10036A8E8 /* Menubar Toggle.entitlements */, E39CF8341BB826B60036A8E8 /* NSImage+Luminance.h */, E39CF8351BB826B60036A8E8 /* NSImage+Luminance.m */, E39CF8371BB82B3E0036A8E8 /* LPWallpaperObserver.h */, E39CF8381BB82B3E0036A8E8 /* LPWallpaperObserver.m */, E39CF8201BB805CE0036A8E8 /* AppDelegate.h */, E39CF8211BB805CE0036A8E8 /* AppDelegate.m */, E39CF8261BB805CE0036A8E8 /* Assets.xcassets */, E39CF8281BB805CE0036A8E8 /* MainMenu.xib */, E39CF82B1BB805CE0036A8E8 /* Info.plist */, E39CF8231BB805CE0036A8E8 /* Supporting Files */, E3CBFB511E11224B004D51A6 /* change_theme.txt */, E3CBFB531E11227D004D51A6 /* get_theme.txt */, ); path = "Menubar Toggle"; sourceTree = ""; }; E39CF8231BB805CE0036A8E8 /* Supporting Files */ = { isa = PBXGroup; children = ( E39CF8241BB805CE0036A8E8 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ E39CF81C1BB805CE0036A8E8 /* Menubar Toggle */ = { isa = PBXNativeTarget; buildConfigurationList = E39CF82E1BB805CE0036A8E8 /* Build configuration list for PBXNativeTarget "Menubar Toggle" */; buildPhases = ( E39CF8191BB805CE0036A8E8 /* Sources */, E39CF81A1BB805CE0036A8E8 /* Frameworks */, E39CF81B1BB805CE0036A8E8 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "Menubar Toggle"; productName = "Menubar Toggle"; productReference = E39CF81D1BB805CE0036A8E8 /* Menubar Toggle.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ E39CF8151BB805CE0036A8E8 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0700; ORGANIZATIONNAME = Leonspok; TargetAttributes = { E39CF81C1BB805CE0036A8E8 = { CreatedOnToolsVersion = 7.0; DevelopmentTeam = 6KXZX3AW22; ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.Sandbox = { enabled = 0; }; }; }; }; }; buildConfigurationList = E39CF8181BB805CE0036A8E8 /* Build configuration list for PBXProject "Menubar Toggle" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = E39CF8141BB805CE0036A8E8; productRefGroup = E39CF81E1BB805CE0036A8E8 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( E39CF81C1BB805CE0036A8E8 /* Menubar Toggle */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ E39CF81B1BB805CE0036A8E8 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( E3CBFB521E11224B004D51A6 /* change_theme.txt in Resources */, E3CBFB541E11227D004D51A6 /* get_theme.txt in Resources */, E39CF8271BB805CE0036A8E8 /* Assets.xcassets in Resources */, E39CF82A1BB805CE0036A8E8 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ E39CF8191BB805CE0036A8E8 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( E39CF8251BB805CE0036A8E8 /* main.m in Sources */, E39CF8391BB82B3E0036A8E8 /* LPWallpaperObserver.m in Sources */, E39CF8361BB826B60036A8E8 /* NSImage+Luminance.m in Sources */, E39CF8221BB805CE0036A8E8 /* AppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ E39CF8281BB805CE0036A8E8 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( E39CF8291BB805CE0036A8E8 /* Base */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ E39CF82C1BB805CE0036A8E8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; E39CF82D1BB805CE0036A8E8 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; }; name = Release; }; E39CF82F1BB805CE0036A8E8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = 6KXZX3AW22; INFOPLIST_FILE = "Menubar Toggle/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = "com.leonspok.osx.Menubar-Toggle"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; E39CF8301BB805CE0036A8E8 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = 6KXZX3AW22; INFOPLIST_FILE = "Menubar Toggle/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_BUNDLE_IDENTIFIER = "com.leonspok.osx.Menubar-Toggle"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ E39CF8181BB805CE0036A8E8 /* Build configuration list for PBXProject "Menubar Toggle" */ = { isa = XCConfigurationList; buildConfigurations = ( E39CF82C1BB805CE0036A8E8 /* Debug */, E39CF82D1BB805CE0036A8E8 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; E39CF82E1BB805CE0036A8E8 /* Build configuration list for PBXNativeTarget "Menubar Toggle" */ = { isa = XCConfigurationList; buildConfigurations = ( E39CF82F1BB805CE0036A8E8 /* Debug */, E39CF8301BB805CE0036A8E8 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = E39CF8151BB805CE0036A8E8 /* Project object */; } ================================================ FILE: Menubar Toggle/Menubar Toggle.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: README.md ================================================ # Menubar Toggle Dark wallpaper - dark OS X, light wallpaper - light OS X. That's so simple. Download Menubar Toggle [here](https://github.com/leonspok/Menubar-Toggle/releases). *** Folder **/DMG** contains all necessary files to create **.dmg** file with [appdmg](https://github.com/LinusU/node-appdmg).