├── .gitignore ├── NinjaMode.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── nirbhay.xcuserdatad │ └── xcschemes │ ├── NinjaMode.xcscheme │ └── xcschememanagement.plist ├── NinjaMode ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── MainMenu.xib ├── Images.xcassets │ └── AppIcon.appiconset │ │ ├── 128x128.png │ │ ├── 16x16.png │ │ ├── 256x256-1.png │ │ ├── 256x256.png │ │ ├── 32x32-1.png │ │ ├── 32x32.png │ │ ├── 512x512-1.png │ │ ├── 512x512-2.png │ │ ├── 512x512.png │ │ ├── 64x64.png │ │ └── Contents.json ├── Info.plist ├── ThemeToggle.scpt ├── ThemeToggle.txt ├── main.m └── switchIcon.png ├── NinjaModeTests ├── Info.plist └── NinjaModeTests.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | NinjaMode.xcodeproj/xcuserdata/nirbhay.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist 2 | *.xccheckout 3 | *xcuserdata* 4 | *.xcuserstate 5 | *.DS_STORE 6 | -------------------------------------------------------------------------------- /NinjaMode.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BE7C115219E56B4F001A6220 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BE7C115119E56B4F001A6220 /* main.m */; }; 11 | BE7C115519E56B4F001A6220 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = BE7C115419E56B4F001A6220 /* AppDelegate.m */; }; 12 | BE7C115719E56B4F001A6220 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BE7C115619E56B4F001A6220 /* Images.xcassets */; }; 13 | BE7C115A19E56B4F001A6220 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = BE7C115819E56B4F001A6220 /* MainMenu.xib */; }; 14 | BE7C116619E56B4F001A6220 /* NinjaModeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BE7C116519E56B4F001A6220 /* NinjaModeTests.m */; }; 15 | BE7C117019E57841001A6220 /* switchIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = BE7C116F19E57841001A6220 /* switchIcon.png */; }; 16 | EBC23A051DF34AFB006DB181 /* ThemeToggle.scpt in Resources */ = {isa = PBXBuildFile; fileRef = EBC23A041DF34AFB006DB181 /* ThemeToggle.scpt */; }; 17 | EBC23A071DF34BE3006DB181 /* ThemeToggle.txt in Resources */ = {isa = PBXBuildFile; fileRef = EBC23A061DF34BE3006DB181 /* ThemeToggle.txt */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | BE7C116019E56B4F001A6220 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = BE7C114419E56B4F001A6220 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = BE7C114B19E56B4F001A6220; 26 | remoteInfo = NinjaMode; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | BE7C114C19E56B4F001A6220 /* NinjaMode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NinjaMode.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | BE7C115019E56B4F001A6220 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | BE7C115119E56B4F001A6220 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | BE7C115319E56B4F001A6220 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 35 | BE7C115419E56B4F001A6220 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 36 | BE7C115619E56B4F001A6220 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 37 | BE7C115919E56B4F001A6220 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 38 | BE7C115F19E56B4F001A6220 /* NinjaModeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NinjaModeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | BE7C116419E56B4F001A6220 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 40 | BE7C116519E56B4F001A6220 /* NinjaModeTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NinjaModeTests.m; sourceTree = ""; }; 41 | BE7C116F19E57841001A6220 /* switchIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = switchIcon.png; sourceTree = ""; }; 42 | EBC23A041DF34AFB006DB181 /* ThemeToggle.scpt */ = {isa = PBXFileReference; lastKnownFileType = file; path = ThemeToggle.scpt; sourceTree = ""; }; 43 | EBC23A061DF34BE3006DB181 /* ThemeToggle.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ThemeToggle.txt; sourceTree = ""; }; 44 | /* End PBXFileReference section */ 45 | 46 | /* Begin PBXFrameworksBuildPhase section */ 47 | BE7C114919E56B4F001A6220 /* Frameworks */ = { 48 | isa = PBXFrameworksBuildPhase; 49 | buildActionMask = 2147483647; 50 | files = ( 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | BE7C115C19E56B4F001A6220 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | BE7C114319E56B4F001A6220 = { 65 | isa = PBXGroup; 66 | children = ( 67 | BE7C114E19E56B4F001A6220 /* NinjaMode */, 68 | BE7C116219E56B4F001A6220 /* NinjaModeTests */, 69 | BE7C114D19E56B4F001A6220 /* Products */, 70 | ); 71 | sourceTree = ""; 72 | }; 73 | BE7C114D19E56B4F001A6220 /* Products */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | BE7C114C19E56B4F001A6220 /* NinjaMode.app */, 77 | BE7C115F19E56B4F001A6220 /* NinjaModeTests.xctest */, 78 | ); 79 | name = Products; 80 | sourceTree = ""; 81 | }; 82 | BE7C114E19E56B4F001A6220 /* NinjaMode */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | EBC23A061DF34BE3006DB181 /* ThemeToggle.txt */, 86 | BE7C116F19E57841001A6220 /* switchIcon.png */, 87 | BE7C115319E56B4F001A6220 /* AppDelegate.h */, 88 | BE7C115419E56B4F001A6220 /* AppDelegate.m */, 89 | BE7C115619E56B4F001A6220 /* Images.xcassets */, 90 | BE7C115819E56B4F001A6220 /* MainMenu.xib */, 91 | BE7C114F19E56B4F001A6220 /* Supporting Files */, 92 | ); 93 | path = NinjaMode; 94 | sourceTree = ""; 95 | }; 96 | BE7C114F19E56B4F001A6220 /* Supporting Files */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | BE7C115019E56B4F001A6220 /* Info.plist */, 100 | BE7C115119E56B4F001A6220 /* main.m */, 101 | EBC23A041DF34AFB006DB181 /* ThemeToggle.scpt */, 102 | ); 103 | name = "Supporting Files"; 104 | sourceTree = ""; 105 | }; 106 | BE7C116219E56B4F001A6220 /* NinjaModeTests */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | BE7C116519E56B4F001A6220 /* NinjaModeTests.m */, 110 | BE7C116319E56B4F001A6220 /* Supporting Files */, 111 | ); 112 | path = NinjaModeTests; 113 | sourceTree = ""; 114 | }; 115 | BE7C116319E56B4F001A6220 /* Supporting Files */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | BE7C116419E56B4F001A6220 /* Info.plist */, 119 | ); 120 | name = "Supporting Files"; 121 | sourceTree = ""; 122 | }; 123 | /* End PBXGroup section */ 124 | 125 | /* Begin PBXNativeTarget section */ 126 | BE7C114B19E56B4F001A6220 /* NinjaMode */ = { 127 | isa = PBXNativeTarget; 128 | buildConfigurationList = BE7C116919E56B4F001A6220 /* Build configuration list for PBXNativeTarget "NinjaMode" */; 129 | buildPhases = ( 130 | BE7C114819E56B4F001A6220 /* Sources */, 131 | BE7C114919E56B4F001A6220 /* Frameworks */, 132 | BE7C114A19E56B4F001A6220 /* Resources */, 133 | ); 134 | buildRules = ( 135 | ); 136 | dependencies = ( 137 | ); 138 | name = NinjaMode; 139 | productName = NinjaMode; 140 | productReference = BE7C114C19E56B4F001A6220 /* NinjaMode.app */; 141 | productType = "com.apple.product-type.application"; 142 | }; 143 | BE7C115E19E56B4F001A6220 /* NinjaModeTests */ = { 144 | isa = PBXNativeTarget; 145 | buildConfigurationList = BE7C116C19E56B4F001A6220 /* Build configuration list for PBXNativeTarget "NinjaModeTests" */; 146 | buildPhases = ( 147 | BE7C115B19E56B4F001A6220 /* Sources */, 148 | BE7C115C19E56B4F001A6220 /* Frameworks */, 149 | BE7C115D19E56B4F001A6220 /* Resources */, 150 | ); 151 | buildRules = ( 152 | ); 153 | dependencies = ( 154 | BE7C116119E56B4F001A6220 /* PBXTargetDependency */, 155 | ); 156 | name = NinjaModeTests; 157 | productName = NinjaModeTests; 158 | productReference = BE7C115F19E56B4F001A6220 /* NinjaModeTests.xctest */; 159 | productType = "com.apple.product-type.bundle.unit-test"; 160 | }; 161 | /* End PBXNativeTarget section */ 162 | 163 | /* Begin PBXProject section */ 164 | BE7C114419E56B4F001A6220 /* Project object */ = { 165 | isa = PBXProject; 166 | attributes = { 167 | LastUpgradeCheck = 0810; 168 | ORGANIZATIONNAME = NSRover; 169 | TargetAttributes = { 170 | BE7C114B19E56B4F001A6220 = { 171 | CreatedOnToolsVersion = 6.0.1; 172 | }; 173 | BE7C115E19E56B4F001A6220 = { 174 | CreatedOnToolsVersion = 6.0.1; 175 | TestTargetID = BE7C114B19E56B4F001A6220; 176 | }; 177 | }; 178 | }; 179 | buildConfigurationList = BE7C114719E56B4F001A6220 /* Build configuration list for PBXProject "NinjaMode" */; 180 | compatibilityVersion = "Xcode 3.2"; 181 | developmentRegion = English; 182 | hasScannedForEncodings = 0; 183 | knownRegions = ( 184 | en, 185 | Base, 186 | ); 187 | mainGroup = BE7C114319E56B4F001A6220; 188 | productRefGroup = BE7C114D19E56B4F001A6220 /* Products */; 189 | projectDirPath = ""; 190 | projectRoot = ""; 191 | targets = ( 192 | BE7C114B19E56B4F001A6220 /* NinjaMode */, 193 | BE7C115E19E56B4F001A6220 /* NinjaModeTests */, 194 | ); 195 | }; 196 | /* End PBXProject section */ 197 | 198 | /* Begin PBXResourcesBuildPhase section */ 199 | BE7C114A19E56B4F001A6220 /* Resources */ = { 200 | isa = PBXResourcesBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | BE7C117019E57841001A6220 /* switchIcon.png in Resources */, 204 | EBC23A051DF34AFB006DB181 /* ThemeToggle.scpt in Resources */, 205 | BE7C115719E56B4F001A6220 /* Images.xcassets in Resources */, 206 | BE7C115A19E56B4F001A6220 /* MainMenu.xib in Resources */, 207 | EBC23A071DF34BE3006DB181 /* ThemeToggle.txt in Resources */, 208 | ); 209 | runOnlyForDeploymentPostprocessing = 0; 210 | }; 211 | BE7C115D19E56B4F001A6220 /* Resources */ = { 212 | isa = PBXResourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | }; 218 | /* End PBXResourcesBuildPhase section */ 219 | 220 | /* Begin PBXSourcesBuildPhase section */ 221 | BE7C114819E56B4F001A6220 /* Sources */ = { 222 | isa = PBXSourcesBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | BE7C115519E56B4F001A6220 /* AppDelegate.m in Sources */, 226 | BE7C115219E56B4F001A6220 /* main.m in Sources */, 227 | ); 228 | runOnlyForDeploymentPostprocessing = 0; 229 | }; 230 | BE7C115B19E56B4F001A6220 /* Sources */ = { 231 | isa = PBXSourcesBuildPhase; 232 | buildActionMask = 2147483647; 233 | files = ( 234 | BE7C116619E56B4F001A6220 /* NinjaModeTests.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXTargetDependency section */ 241 | BE7C116119E56B4F001A6220 /* PBXTargetDependency */ = { 242 | isa = PBXTargetDependency; 243 | target = BE7C114B19E56B4F001A6220 /* NinjaMode */; 244 | targetProxy = BE7C116019E56B4F001A6220 /* PBXContainerItemProxy */; 245 | }; 246 | /* End PBXTargetDependency section */ 247 | 248 | /* Begin PBXVariantGroup section */ 249 | BE7C115819E56B4F001A6220 /* MainMenu.xib */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | BE7C115919E56B4F001A6220 /* Base */, 253 | ); 254 | name = MainMenu.xib; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | BE7C116719E56B4F001A6220 /* Debug */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | ALWAYS_SEARCH_USER_PATHS = NO; 264 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 265 | CLANG_CXX_LIBRARY = "libc++"; 266 | CLANG_ENABLE_MODULES = YES; 267 | CLANG_ENABLE_OBJC_ARC = YES; 268 | CLANG_WARN_BOOL_CONVERSION = YES; 269 | CLANG_WARN_CONSTANT_CONVERSION = YES; 270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 271 | CLANG_WARN_EMPTY_BODY = YES; 272 | CLANG_WARN_ENUM_CONVERSION = YES; 273 | CLANG_WARN_INFINITE_RECURSION = YES; 274 | CLANG_WARN_INT_CONVERSION = YES; 275 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 276 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 277 | CLANG_WARN_UNREACHABLE_CODE = YES; 278 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 279 | CODE_SIGN_IDENTITY = "-"; 280 | COPY_PHASE_STRIP = NO; 281 | ENABLE_STRICT_OBJC_MSGSEND = YES; 282 | ENABLE_TESTABILITY = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_DYNAMIC_NO_PIC = NO; 285 | GCC_NO_COMMON_BLOCKS = YES; 286 | GCC_OPTIMIZATION_LEVEL = 0; 287 | GCC_PREPROCESSOR_DEFINITIONS = ( 288 | "DEBUG=1", 289 | "$(inherited)", 290 | ); 291 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 294 | GCC_WARN_UNDECLARED_SELECTOR = YES; 295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 296 | GCC_WARN_UNUSED_FUNCTION = YES; 297 | GCC_WARN_UNUSED_VARIABLE = YES; 298 | MACOSX_DEPLOYMENT_TARGET = 10.10; 299 | MTL_ENABLE_DEBUG_INFO = YES; 300 | ONLY_ACTIVE_ARCH = YES; 301 | SDKROOT = macosx; 302 | }; 303 | name = Debug; 304 | }; 305 | BE7C116819E56B4F001A6220 /* Release */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ALWAYS_SEARCH_USER_PATHS = NO; 309 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 310 | CLANG_CXX_LIBRARY = "libc++"; 311 | CLANG_ENABLE_MODULES = YES; 312 | CLANG_ENABLE_OBJC_ARC = YES; 313 | CLANG_WARN_BOOL_CONVERSION = YES; 314 | CLANG_WARN_CONSTANT_CONVERSION = YES; 315 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 316 | CLANG_WARN_EMPTY_BODY = YES; 317 | CLANG_WARN_ENUM_CONVERSION = YES; 318 | CLANG_WARN_INFINITE_RECURSION = YES; 319 | CLANG_WARN_INT_CONVERSION = YES; 320 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 321 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 322 | CLANG_WARN_UNREACHABLE_CODE = YES; 323 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 324 | CODE_SIGN_IDENTITY = "-"; 325 | COPY_PHASE_STRIP = YES; 326 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 327 | ENABLE_NS_ASSERTIONS = NO; 328 | ENABLE_STRICT_OBJC_MSGSEND = YES; 329 | GCC_C_LANGUAGE_STANDARD = gnu99; 330 | GCC_NO_COMMON_BLOCKS = YES; 331 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 332 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 333 | GCC_WARN_UNDECLARED_SELECTOR = YES; 334 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 335 | GCC_WARN_UNUSED_FUNCTION = YES; 336 | GCC_WARN_UNUSED_VARIABLE = YES; 337 | MACOSX_DEPLOYMENT_TARGET = 10.10; 338 | MTL_ENABLE_DEBUG_INFO = NO; 339 | SDKROOT = macosx; 340 | }; 341 | name = Release; 342 | }; 343 | BE7C116A19E56B4F001A6220 /* Debug */ = { 344 | isa = XCBuildConfiguration; 345 | buildSettings = { 346 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 347 | COMBINE_HIDPI_IMAGES = YES; 348 | INFOPLIST_FILE = NinjaMode/Info.plist; 349 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 350 | PRODUCT_BUNDLE_IDENTIFIER = "com.nsrover.$(PRODUCT_NAME:rfc1034identifier)"; 351 | PRODUCT_NAME = "$(TARGET_NAME)"; 352 | }; 353 | name = Debug; 354 | }; 355 | BE7C116B19E56B4F001A6220 /* Release */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 359 | COMBINE_HIDPI_IMAGES = YES; 360 | INFOPLIST_FILE = NinjaMode/Info.plist; 361 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 362 | PRODUCT_BUNDLE_IDENTIFIER = "com.nsrover.$(PRODUCT_NAME:rfc1034identifier)"; 363 | PRODUCT_NAME = "$(TARGET_NAME)"; 364 | }; 365 | name = Release; 366 | }; 367 | BE7C116D19E56B4F001A6220 /* Debug */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | BUNDLE_LOADER = "$(TEST_HOST)"; 371 | COMBINE_HIDPI_IMAGES = YES; 372 | FRAMEWORK_SEARCH_PATHS = ( 373 | "$(DEVELOPER_FRAMEWORKS_DIR)", 374 | "$(inherited)", 375 | ); 376 | GCC_PREPROCESSOR_DEFINITIONS = ( 377 | "DEBUG=1", 378 | "$(inherited)", 379 | ); 380 | INFOPLIST_FILE = NinjaModeTests/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 382 | PRODUCT_BUNDLE_IDENTIFIER = "com.nsrover.$(PRODUCT_NAME:rfc1034identifier)"; 383 | PRODUCT_NAME = "$(TARGET_NAME)"; 384 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NinjaMode.app/Contents/MacOS/NinjaMode"; 385 | }; 386 | name = Debug; 387 | }; 388 | BE7C116E19E56B4F001A6220 /* Release */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | BUNDLE_LOADER = "$(TEST_HOST)"; 392 | COMBINE_HIDPI_IMAGES = YES; 393 | FRAMEWORK_SEARCH_PATHS = ( 394 | "$(DEVELOPER_FRAMEWORKS_DIR)", 395 | "$(inherited)", 396 | ); 397 | INFOPLIST_FILE = NinjaModeTests/Info.plist; 398 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 399 | PRODUCT_BUNDLE_IDENTIFIER = "com.nsrover.$(PRODUCT_NAME:rfc1034identifier)"; 400 | PRODUCT_NAME = "$(TARGET_NAME)"; 401 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NinjaMode.app/Contents/MacOS/NinjaMode"; 402 | }; 403 | name = Release; 404 | }; 405 | /* End XCBuildConfiguration section */ 406 | 407 | /* Begin XCConfigurationList section */ 408 | BE7C114719E56B4F001A6220 /* Build configuration list for PBXProject "NinjaMode" */ = { 409 | isa = XCConfigurationList; 410 | buildConfigurations = ( 411 | BE7C116719E56B4F001A6220 /* Debug */, 412 | BE7C116819E56B4F001A6220 /* Release */, 413 | ); 414 | defaultConfigurationIsVisible = 0; 415 | defaultConfigurationName = Release; 416 | }; 417 | BE7C116919E56B4F001A6220 /* Build configuration list for PBXNativeTarget "NinjaMode" */ = { 418 | isa = XCConfigurationList; 419 | buildConfigurations = ( 420 | BE7C116A19E56B4F001A6220 /* Debug */, 421 | BE7C116B19E56B4F001A6220 /* Release */, 422 | ); 423 | defaultConfigurationIsVisible = 0; 424 | defaultConfigurationName = Release; 425 | }; 426 | BE7C116C19E56B4F001A6220 /* Build configuration list for PBXNativeTarget "NinjaModeTests" */ = { 427 | isa = XCConfigurationList; 428 | buildConfigurations = ( 429 | BE7C116D19E56B4F001A6220 /* Debug */, 430 | BE7C116E19E56B4F001A6220 /* Release */, 431 | ); 432 | defaultConfigurationIsVisible = 0; 433 | defaultConfigurationName = Release; 434 | }; 435 | /* End XCConfigurationList section */ 436 | }; 437 | rootObject = BE7C114419E56B4F001A6220 /* Project object */; 438 | } 439 | -------------------------------------------------------------------------------- /NinjaMode.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NinjaMode.xcodeproj/xcuserdata/nirbhay.xcuserdatad/xcschemes/NinjaMode.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /NinjaMode.xcodeproj/xcuserdata/nirbhay.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NinjaMode.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | BE7C114B19E56B4F001A6220 16 | 17 | primary 18 | 19 | 20 | BE7C115E19E56B4F001A6220 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /NinjaMode/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // NinjaMode 4 | // 5 | // Created by Nirbhay Agarwal on 08/10/14. 6 | // Copyright (c) 2014 NSRover. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /NinjaMode/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // NinjaMode 4 | // 5 | // Created by Nirbhay Agarwal on 08/10/14. 6 | // Updated by Benedikt-Alexander Mokroß on 21/04/2017 (Fixed depricated API). 7 | // Copyright (c) 2014 NSRover. All rights reserved. 8 | // 9 | 10 | #import "AppDelegate.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @property (weak) IBOutlet NSWindow *window; 15 | 16 | @property (strong, nonatomic) NSStatusItem *statusItem; 17 | @property (assign, nonatomic) BOOL darkModeOn; 18 | 19 | @end 20 | 21 | @implementation AppDelegate 22 | 23 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 24 | self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]; 25 | 26 | NSStatusBarButton* statusBarButton = _statusItem.button; 27 | statusBarButton.image = [NSImage imageNamed:@"switchIcon.png"]; 28 | [statusBarButton.image setTemplate:YES]; 29 | 30 | statusButton.highlighted = NO; 31 | statusBarButton.toolTip = @"control-click to quit"; 32 | 33 | [statusBarButton setAction:@selector(itemClicked:)]; 34 | 35 | [self refreshDarkMode]; 36 | } 37 | 38 | - (void)refreshDarkMode { 39 | NSString * value = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"]; 40 | if ([value isEqualToString:@"Dark"]) { 41 | self.darkModeOn = YES; 42 | } 43 | else { 44 | self.darkModeOn = NO; 45 | } 46 | } 47 | 48 | - (void)itemClicked:(id)sender { 49 | //Look for control click, close app if so 50 | NSEvent *event = [NSApp currentEvent]; 51 | if([event modifierFlags] & NSControlKeyMask) { 52 | [[NSApplication sharedApplication] terminate:self]; 53 | return; 54 | } 55 | 56 | //Change theme 57 | [self toggleTheme]; 58 | 59 | //Toggle darkMode 60 | _darkModeOn = !_darkModeOn; 61 | 62 | //Change desktop 63 | if (_darkModeOn) { 64 | [self makeDesktopDark]; 65 | } 66 | else { 67 | [self makeDesktopBright]; 68 | } 69 | } 70 | 71 | - (void)toggleTheme { 72 | NSString* path = [[NSBundle mainBundle] pathForResource:@"ThemeToggle" ofType:@"scpt"]; 73 | NSURL* url = [NSURL fileURLWithPath:path]; 74 | NSDictionary* errors = [NSDictionary dictionary]; 75 | NSAppleScript* appleScript = [[NSAppleScript alloc] initWithContentsOfURL:url error:&errors]; 76 | [appleScript executeAndReturnError:nil]; 77 | } 78 | 79 | - (void)makeDesktopDark { 80 | //set wallpaper 81 | [self changeWallpaperWithImagePath:[@"~/Documents/NinjaModes/dark.png" 82 | stringByExpandingTildeInPath]]; 83 | } 84 | 85 | - (void)makeDesktopBright { 86 | //set wallpaper 87 | [self changeWallpaperWithImagePath:[@"~/Documents/NinjaModes/bright.png" 88 | stringByExpandingTildeInPath]]; 89 | } 90 | 91 | - (void)changeWallpaperWithImagePath:(NSString *)path { 92 | 93 | //If NinjaModes directory does not exist, assume not interested. 94 | if (![[NSFileManager defaultManager] fileExistsAtPath:[@"~/Documents/NinjaModes" stringByExpandingTildeInPath]]) { 95 | return; 96 | } 97 | 98 | NSError *error; 99 | [[NSWorkspace sharedWorkspace] setDesktopImageURL:[NSURL fileURLWithPath:path] 100 | forScreen:[NSScreen mainScreen] 101 | options:[NSDictionary dictionaryWithObjectsAndKeys: 102 | nil, NSWorkspaceDesktopImageFillColorKey, 103 | [NSNumber numberWithBool:NO], NSWorkspaceDesktopImageAllowClippingKey, 104 | [NSNumber numberWithInteger:NSImageScaleProportionallyUpOrDown], NSWorkspaceDesktopImageScalingKey, nil] 105 | error:&error]; 106 | if (error) { 107 | [[NSApplication sharedApplication] presentError: error 108 | modalForWindow: self.window 109 | delegate: nil 110 | didPresentSelector: nil 111 | contextInfo: NULL]; 112 | } 113 | } 114 | 115 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 116 | //Attempt to restore things back the way we found them 117 | [self makeDesktopBright]; 118 | } 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /NinjaMode/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/Images.xcassets/AppIcon.appiconset/128x128.png -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/Images.xcassets/AppIcon.appiconset/16x16.png -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/256x256-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/Images.xcassets/AppIcon.appiconset/256x256-1.png -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/Images.xcassets/AppIcon.appiconset/256x256.png -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/32x32-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/Images.xcassets/AppIcon.appiconset/32x32-1.png -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/Images.xcassets/AppIcon.appiconset/32x32.png -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/512x512-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/Images.xcassets/AppIcon.appiconset/512x512-1.png -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/512x512-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/Images.xcassets/AppIcon.appiconset/512x512-2.png -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/Images.xcassets/AppIcon.appiconset/512x512.png -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/Images.xcassets/AppIcon.appiconset/64x64.png -------------------------------------------------------------------------------- /NinjaMode/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "16x16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "32x32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "32x32-1.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "64x64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "128x128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "256x256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "256x256-1.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "512x512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "512x512-1.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "512x512-2.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /NinjaMode/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | LSUIElement 28 | 29 | NSHumanReadableCopyright 30 | Copyright © 2014 NSRover. All rights reserved. 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /NinjaMode/ThemeToggle.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/ThemeToggle.scpt -------------------------------------------------------------------------------- /NinjaMode/ThemeToggle.txt: -------------------------------------------------------------------------------- 1 | # ThemeToggle as .txt for reference. 2 | # Compiled applescript ThemeToggle.scpt can be found under Supporting Files directory 3 | 4 | tell application "System Events" 5 | tell appearance preferences to set dark mode to not dark mode 6 | end tell 7 | -------------------------------------------------------------------------------- /NinjaMode/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // NinjaMode 4 | // 5 | // Created by Nirbhay Agarwal on 08/10/14. 6 | // Copyright (c) 2014 NSRover. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /NinjaMode/switchIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NSRover/NinjaMode/9b3951ec21fedb2a2ff19f1fad54cabdf8f6148b/NinjaMode/switchIcon.png -------------------------------------------------------------------------------- /NinjaModeTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /NinjaModeTests/NinjaModeTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // NinjaModeTests.m 3 | // NinjaModeTests 4 | // 5 | // Created by Nirbhay Agarwal on 08/10/14. 6 | // Copyright (c) 2014 NSRover. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface NinjaModeTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation NinjaModeTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | NinjaMode 2 | ========= 3 | 4 | OS X Yosemite gave us the awesome Dark Mode feature, but it is still a pain to switch between the modes. 5 | 6 | This little menubar utility give a quick way to toggle between the modes. 7 | 8 | (To quit the app, you need to control-click the icon) 9 | 10 | ## Installation: 11 | ensure that you have xcode command line tools installed. 12 | ``` 13 | git clone https://github.com/NSRover/NinjaMode.git 14 | cd NinjaMode 15 | 16 | sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer 17 | xcodebuild -target "NinjaMode.xcodeproj" -scheme "NinjaMode" -configuration "Debug" CONFIGURATION_BUILD_DIR='TestBuild' 18 | open TestBuild/NinjaMode.app/ 19 | 20 | ``` 21 | --------------------------------------------------------------------------------