├── .gitignore ├── LICENSE ├── Overkill.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── Overkill ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Full-1.png │ │ ├── Full-2.png │ │ ├── Full-3.png │ │ ├── Full-4.png │ │ ├── Full-5.png │ │ └── Full.png │ ├── Contents.json │ └── statusIcon.imageset │ │ ├── Contents.json │ │ ├── Light Small-1.png │ │ └── Light Small-2.png ├── Base.lproj │ └── Main.storyboard ├── Info.plist ├── LaunchStarter.swift ├── OverkillController.swift ├── PreferencesWindow.swift └── PreferencesWindow.xib └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | .DS_STORE 6 | 7 | ## Build generated 8 | build/ 9 | DerivedData/ 10 | 11 | ## Various settings 12 | *.pbxuser 13 | !default.pbxuser 14 | *.mode1v3 15 | !default.mode1v3 16 | *.mode2v3 17 | !default.mode2v3 18 | *.perspectivev3 19 | !default.perspectivev3 20 | xcuserdata/ 21 | 22 | ## Other 23 | *.moved-aside 24 | *.xccheckout 25 | *.xcscmblueprint 26 | 27 | ## Obj-C/Swift specific 28 | *.hmap 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | # Package.pins 42 | .build/ 43 | 44 | # CocoaPods 45 | # 46 | # We recommend against adding the Pods directory to your .gitignore. However 47 | # you should judge for yourself, the pros and cons are mentioned at: 48 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 49 | # 50 | # Pods/ 51 | 52 | # Carthage 53 | # 54 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 55 | # Carthage/Checkouts 56 | 57 | Carthage/Build 58 | 59 | # fastlane 60 | # 61 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 62 | # screenshots whenever they are needed. 63 | # For more information about the recommended setup visit: 64 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 65 | 66 | fastlane/report.xml 67 | fastlane/Preview.html 68 | fastlane/screenshots 69 | fastlane/test_output 70 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Felix Krause 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | The above license does not apply to the LaunchStarter.swift file, which was taken from https://gist.github.com/plapier/f8e1dde1b1624dfbb3e4 24 | -------------------------------------------------------------------------------- /Overkill.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CA0257141F3F952600F5D9BE /* OverkillController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA0257131F3F952600F5D9BE /* OverkillController.swift */; }; 11 | CA0257161F3F978A00F5D9BE /* PreferencesWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = CA0257151F3F978A00F5D9BE /* PreferencesWindow.xib */; }; 12 | CA0257181F3F97D300F5D9BE /* PreferencesWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA0257171F3F97D300F5D9BE /* PreferencesWindow.swift */; }; 13 | CA14B54A1F3F933A00C9F139 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA14B5491F3F933A00C9F139 /* AppDelegate.swift */; }; 14 | CA14B54E1F3F933A00C9F139 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CA14B54D1F3F933A00C9F139 /* Assets.xcassets */; }; 15 | CA14B5511F3F933A00C9F139 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CA14B54F1F3F933A00C9F139 /* Main.storyboard */; }; 16 | CA4AF9641F45683B006346DB /* LaunchStarter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA4AF9631F45683B006346DB /* LaunchStarter.swift */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | CA0257131F3F952600F5D9BE /* OverkillController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OverkillController.swift; sourceTree = ""; }; 21 | CA0257151F3F978A00F5D9BE /* PreferencesWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PreferencesWindow.xib; sourceTree = ""; }; 22 | CA0257171F3F97D300F5D9BE /* PreferencesWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferencesWindow.swift; sourceTree = ""; }; 23 | CA14B5461F3F933A00C9F139 /* Overkill.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Overkill.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | CA14B5491F3F933A00C9F139 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 25 | CA14B54D1F3F933A00C9F139 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 26 | CA14B5501F3F933A00C9F139 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 27 | CA14B5521F3F933A00C9F139 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | CA4AF9631F45683B006346DB /* LaunchStarter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LaunchStarter.swift; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | CA14B5431F3F933A00C9F139 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | CA14B53D1F3F933A00C9F139 = { 43 | isa = PBXGroup; 44 | children = ( 45 | CA14B5481F3F933A00C9F139 /* Overkill */, 46 | CA14B5471F3F933A00C9F139 /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | CA14B5471F3F933A00C9F139 /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | CA14B5461F3F933A00C9F139 /* Overkill.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | CA14B5481F3F933A00C9F139 /* Overkill */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | CA14B5491F3F933A00C9F139 /* AppDelegate.swift */, 62 | CA14B54D1F3F933A00C9F139 /* Assets.xcassets */, 63 | CA14B54F1F3F933A00C9F139 /* Main.storyboard */, 64 | CA14B5521F3F933A00C9F139 /* Info.plist */, 65 | CA0257131F3F952600F5D9BE /* OverkillController.swift */, 66 | CA0257151F3F978A00F5D9BE /* PreferencesWindow.xib */, 67 | CA0257171F3F97D300F5D9BE /* PreferencesWindow.swift */, 68 | CA4AF9631F45683B006346DB /* LaunchStarter.swift */, 69 | ); 70 | path = Overkill; 71 | sourceTree = ""; 72 | }; 73 | /* End PBXGroup section */ 74 | 75 | /* Begin PBXNativeTarget section */ 76 | CA14B5451F3F933A00C9F139 /* Overkill */ = { 77 | isa = PBXNativeTarget; 78 | buildConfigurationList = CA14B5551F3F933A00C9F139 /* Build configuration list for PBXNativeTarget "Overkill" */; 79 | buildPhases = ( 80 | CA14B5421F3F933A00C9F139 /* Sources */, 81 | CA14B5431F3F933A00C9F139 /* Frameworks */, 82 | CA14B5441F3F933A00C9F139 /* Resources */, 83 | ); 84 | buildRules = ( 85 | ); 86 | dependencies = ( 87 | ); 88 | name = Overkill; 89 | productName = Overkill; 90 | productReference = CA14B5461F3F933A00C9F139 /* Overkill.app */; 91 | productType = "com.apple.product-type.application"; 92 | }; 93 | /* End PBXNativeTarget section */ 94 | 95 | /* Begin PBXProject section */ 96 | CA14B53E1F3F933A00C9F139 /* Project object */ = { 97 | isa = PBXProject; 98 | attributes = { 99 | LastSwiftUpdateCheck = 0830; 100 | LastUpgradeCheck = 1000; 101 | ORGANIZATIONNAME = "Felix Krause"; 102 | TargetAttributes = { 103 | CA14B5451F3F933A00C9F139 = { 104 | CreatedOnToolsVersion = 8.3.2; 105 | LastSwiftMigration = 1000; 106 | ProvisioningStyle = Manual; 107 | }; 108 | }; 109 | }; 110 | buildConfigurationList = CA14B5411F3F933A00C9F139 /* Build configuration list for PBXProject "Overkill" */; 111 | compatibilityVersion = "Xcode 3.2"; 112 | developmentRegion = English; 113 | hasScannedForEncodings = 0; 114 | knownRegions = ( 115 | en, 116 | Base, 117 | ); 118 | mainGroup = CA14B53D1F3F933A00C9F139; 119 | productRefGroup = CA14B5471F3F933A00C9F139 /* Products */; 120 | projectDirPath = ""; 121 | projectRoot = ""; 122 | targets = ( 123 | CA14B5451F3F933A00C9F139 /* Overkill */, 124 | ); 125 | }; 126 | /* End PBXProject section */ 127 | 128 | /* Begin PBXResourcesBuildPhase section */ 129 | CA14B5441F3F933A00C9F139 /* Resources */ = { 130 | isa = PBXResourcesBuildPhase; 131 | buildActionMask = 2147483647; 132 | files = ( 133 | CA14B54E1F3F933A00C9F139 /* Assets.xcassets in Resources */, 134 | CA0257161F3F978A00F5D9BE /* PreferencesWindow.xib in Resources */, 135 | CA14B5511F3F933A00C9F139 /* Main.storyboard in Resources */, 136 | ); 137 | runOnlyForDeploymentPostprocessing = 0; 138 | }; 139 | /* End PBXResourcesBuildPhase section */ 140 | 141 | /* Begin PBXSourcesBuildPhase section */ 142 | CA14B5421F3F933A00C9F139 /* Sources */ = { 143 | isa = PBXSourcesBuildPhase; 144 | buildActionMask = 2147483647; 145 | files = ( 146 | CA14B54A1F3F933A00C9F139 /* AppDelegate.swift in Sources */, 147 | CA4AF9641F45683B006346DB /* LaunchStarter.swift in Sources */, 148 | CA0257181F3F97D300F5D9BE /* PreferencesWindow.swift in Sources */, 149 | CA0257141F3F952600F5D9BE /* OverkillController.swift in Sources */, 150 | ); 151 | runOnlyForDeploymentPostprocessing = 0; 152 | }; 153 | /* End PBXSourcesBuildPhase section */ 154 | 155 | /* Begin PBXVariantGroup section */ 156 | CA14B54F1F3F933A00C9F139 /* Main.storyboard */ = { 157 | isa = PBXVariantGroup; 158 | children = ( 159 | CA14B5501F3F933A00C9F139 /* Base */, 160 | ); 161 | name = Main.storyboard; 162 | sourceTree = ""; 163 | }; 164 | /* End PBXVariantGroup section */ 165 | 166 | /* Begin XCBuildConfiguration section */ 167 | CA14B5531F3F933A00C9F139 /* Debug */ = { 168 | isa = XCBuildConfiguration; 169 | buildSettings = { 170 | ALWAYS_SEARCH_USER_PATHS = NO; 171 | CLANG_ANALYZER_NONNULL = YES; 172 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 173 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 174 | CLANG_CXX_LIBRARY = "libc++"; 175 | CLANG_ENABLE_MODULES = YES; 176 | CLANG_ENABLE_OBJC_ARC = YES; 177 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 178 | CLANG_WARN_BOOL_CONVERSION = YES; 179 | CLANG_WARN_COMMA = YES; 180 | CLANG_WARN_CONSTANT_CONVERSION = YES; 181 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 182 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 183 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 184 | CLANG_WARN_EMPTY_BODY = YES; 185 | CLANG_WARN_ENUM_CONVERSION = YES; 186 | CLANG_WARN_INFINITE_RECURSION = YES; 187 | CLANG_WARN_INT_CONVERSION = YES; 188 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 189 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 190 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 191 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 192 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 193 | CLANG_WARN_STRICT_PROTOTYPES = YES; 194 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | CODE_SIGN_IDENTITY = "-"; 198 | COPY_PHASE_STRIP = NO; 199 | DEBUG_INFORMATION_FORMAT = dwarf; 200 | ENABLE_STRICT_OBJC_MSGSEND = YES; 201 | ENABLE_TESTABILITY = YES; 202 | GCC_C_LANGUAGE_STANDARD = gnu99; 203 | GCC_DYNAMIC_NO_PIC = NO; 204 | GCC_NO_COMMON_BLOCKS = YES; 205 | GCC_OPTIMIZATION_LEVEL = 0; 206 | GCC_PREPROCESSOR_DEFINITIONS = ( 207 | "DEBUG=1", 208 | "$(inherited)", 209 | ); 210 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 211 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 212 | GCC_WARN_UNDECLARED_SELECTOR = YES; 213 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 214 | GCC_WARN_UNUSED_FUNCTION = YES; 215 | GCC_WARN_UNUSED_VARIABLE = YES; 216 | MACOSX_DEPLOYMENT_TARGET = 10.10; 217 | MTL_ENABLE_DEBUG_INFO = YES; 218 | ONLY_ACTIVE_ARCH = YES; 219 | SDKROOT = macosx; 220 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 221 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 222 | }; 223 | name = Debug; 224 | }; 225 | CA14B5541F3F933A00C9F139 /* Release */ = { 226 | isa = XCBuildConfiguration; 227 | buildSettings = { 228 | ALWAYS_SEARCH_USER_PATHS = NO; 229 | CLANG_ANALYZER_NONNULL = YES; 230 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 231 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 232 | CLANG_CXX_LIBRARY = "libc++"; 233 | CLANG_ENABLE_MODULES = YES; 234 | CLANG_ENABLE_OBJC_ARC = YES; 235 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 236 | CLANG_WARN_BOOL_CONVERSION = YES; 237 | CLANG_WARN_COMMA = YES; 238 | CLANG_WARN_CONSTANT_CONVERSION = YES; 239 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 240 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 241 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 242 | CLANG_WARN_EMPTY_BODY = YES; 243 | CLANG_WARN_ENUM_CONVERSION = YES; 244 | CLANG_WARN_INFINITE_RECURSION = YES; 245 | CLANG_WARN_INT_CONVERSION = YES; 246 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 247 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 248 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 249 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 250 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 251 | CLANG_WARN_STRICT_PROTOTYPES = YES; 252 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 253 | CLANG_WARN_UNREACHABLE_CODE = YES; 254 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 255 | CODE_SIGN_IDENTITY = "-"; 256 | COPY_PHASE_STRIP = NO; 257 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 258 | ENABLE_NS_ASSERTIONS = NO; 259 | ENABLE_STRICT_OBJC_MSGSEND = YES; 260 | GCC_C_LANGUAGE_STANDARD = gnu99; 261 | GCC_NO_COMMON_BLOCKS = YES; 262 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 263 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 264 | GCC_WARN_UNDECLARED_SELECTOR = YES; 265 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 266 | GCC_WARN_UNUSED_FUNCTION = YES; 267 | GCC_WARN_UNUSED_VARIABLE = YES; 268 | MACOSX_DEPLOYMENT_TARGET = 10.10; 269 | MTL_ENABLE_DEBUG_INFO = NO; 270 | SDKROOT = macosx; 271 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 272 | }; 273 | name = Release; 274 | }; 275 | CA14B5561F3F933A00C9F139 /* Debug */ = { 276 | isa = XCBuildConfiguration; 277 | buildSettings = { 278 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 279 | CODE_SIGN_IDENTITY = "-"; 280 | CODE_SIGN_STYLE = Manual; 281 | COMBINE_HIDPI_IMAGES = YES; 282 | DEVELOPMENT_TEAM = ""; 283 | INFOPLIST_FILE = Overkill/Info.plist; 284 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 285 | PRODUCT_BUNDLE_IDENTIFIER = com.krausefx.Overkill; 286 | PRODUCT_NAME = "$(TARGET_NAME)"; 287 | PROVISIONING_PROFILE_SPECIFIER = ""; 288 | SWIFT_VERSION = 4.2; 289 | }; 290 | name = Debug; 291 | }; 292 | CA14B5571F3F933A00C9F139 /* Release */ = { 293 | isa = XCBuildConfiguration; 294 | buildSettings = { 295 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 296 | CODE_SIGN_IDENTITY = "-"; 297 | CODE_SIGN_STYLE = Manual; 298 | COMBINE_HIDPI_IMAGES = YES; 299 | DEVELOPMENT_TEAM = ""; 300 | INFOPLIST_FILE = Overkill/Info.plist; 301 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 302 | PRODUCT_BUNDLE_IDENTIFIER = com.krausefx.Overkill; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | PROVISIONING_PROFILE_SPECIFIER = ""; 305 | SWIFT_VERSION = 4.2; 306 | }; 307 | name = Release; 308 | }; 309 | /* End XCBuildConfiguration section */ 310 | 311 | /* Begin XCConfigurationList section */ 312 | CA14B5411F3F933A00C9F139 /* Build configuration list for PBXProject "Overkill" */ = { 313 | isa = XCConfigurationList; 314 | buildConfigurations = ( 315 | CA14B5531F3F933A00C9F139 /* Debug */, 316 | CA14B5541F3F933A00C9F139 /* Release */, 317 | ); 318 | defaultConfigurationIsVisible = 0; 319 | defaultConfigurationName = Release; 320 | }; 321 | CA14B5551F3F933A00C9F139 /* Build configuration list for PBXNativeTarget "Overkill" */ = { 322 | isa = XCConfigurationList; 323 | buildConfigurations = ( 324 | CA14B5561F3F933A00C9F139 /* Debug */, 325 | CA14B5571F3F933A00C9F139 /* Release */, 326 | ); 327 | defaultConfigurationIsVisible = 0; 328 | defaultConfigurationName = Release; 329 | }; 330 | /* End XCConfigurationList section */ 331 | }; 332 | rootObject = CA14B53E1F3F933A00C9F139 /* Project object */; 333 | } 334 | -------------------------------------------------------------------------------- /Overkill.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Overkill.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Overkill/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Overkill 4 | // 5 | // Created by Felix Krause on 8/12/17. 6 | // Copyright © 2017 Felix Krause. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | func applicationDidFinishLaunching(_ aNotification: Notification) { 14 | } 15 | 16 | func applicationWillTerminate(_ aNotification: Notification) { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "size" : "128x128", 25 | "idiom" : "mac", 26 | "filename" : "Full-5.png", 27 | "scale" : "1x" 28 | }, 29 | { 30 | "size" : "128x128", 31 | "idiom" : "mac", 32 | "filename" : "Full-4.png", 33 | "scale" : "2x" 34 | }, 35 | { 36 | "size" : "256x256", 37 | "idiom" : "mac", 38 | "filename" : "Full-3.png", 39 | "scale" : "1x" 40 | }, 41 | { 42 | "size" : "256x256", 43 | "idiom" : "mac", 44 | "filename" : "Full-2.png", 45 | "scale" : "2x" 46 | }, 47 | { 48 | "size" : "512x512", 49 | "idiom" : "mac", 50 | "filename" : "Full.png", 51 | "scale" : "1x" 52 | }, 53 | { 54 | "size" : "512x512", 55 | "idiom" : "mac", 56 | "filename" : "Full-1.png", 57 | "scale" : "2x" 58 | } 59 | ], 60 | "info" : { 61 | "version" : 1, 62 | "author" : "xcode" 63 | } 64 | } -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/AppIcon.appiconset/Full-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrauseFx/overkill-for-mac/b8ba6dc9445e424b17486d5a513f660e2ca05985/Overkill/Assets.xcassets/AppIcon.appiconset/Full-1.png -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/AppIcon.appiconset/Full-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrauseFx/overkill-for-mac/b8ba6dc9445e424b17486d5a513f660e2ca05985/Overkill/Assets.xcassets/AppIcon.appiconset/Full-2.png -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/AppIcon.appiconset/Full-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrauseFx/overkill-for-mac/b8ba6dc9445e424b17486d5a513f660e2ca05985/Overkill/Assets.xcassets/AppIcon.appiconset/Full-3.png -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/AppIcon.appiconset/Full-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrauseFx/overkill-for-mac/b8ba6dc9445e424b17486d5a513f660e2ca05985/Overkill/Assets.xcassets/AppIcon.appiconset/Full-4.png -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/AppIcon.appiconset/Full-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrauseFx/overkill-for-mac/b8ba6dc9445e424b17486d5a513f660e2ca05985/Overkill/Assets.xcassets/AppIcon.appiconset/Full-5.png -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/AppIcon.appiconset/Full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrauseFx/overkill-for-mac/b8ba6dc9445e424b17486d5a513f660e2ca05985/Overkill/Assets.xcassets/AppIcon.appiconset/Full.png -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/statusIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Light Small-2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "Light Small-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/statusIcon.imageset/Light Small-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrauseFx/overkill-for-mac/b8ba6dc9445e424b17486d5a513f660e2ca05985/Overkill/Assets.xcassets/statusIcon.imageset/Light Small-1.png -------------------------------------------------------------------------------- /Overkill/Assets.xcassets/statusIcon.imageset/Light Small-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrauseFx/overkill-for-mac/b8ba6dc9445e424b17486d5a513f660e2ca05985/Overkill/Assets.xcassets/statusIcon.imageset/Light Small-2.png -------------------------------------------------------------------------------- /Overkill/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | Default 510 | 511 | 512 | 513 | 514 | 515 | 516 | Left to Right 517 | 518 | 519 | 520 | 521 | 522 | 523 | Right to Left 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | Default 535 | 536 | 537 | 538 | 539 | 540 | 541 | Left to Right 542 | 543 | 544 | 545 | 546 | 547 | 548 | Right to Left 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | -------------------------------------------------------------------------------- /Overkill/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 | CFBundleVersion 22 | 1 23 | LSApplicationCategoryType 24 | public.app-category.productivity 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | LSUIElement 28 | 29 | NSHumanReadableCopyright 30 | Copyright © 2017 Felix Krause. All rights reserved. 31 | NSMainStoryboardFile 32 | Main 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /Overkill/LaunchStarter.swift: -------------------------------------------------------------------------------- 1 | // Taken from https://gist.github.com/plapier/f8e1dde1b1624dfbb3e4 2 | 3 | import Foundation 4 | 5 | // MARK - Public functions 6 | 7 | func applicationIsInStartUpItems() -> Bool { 8 | return itemReferencesInLoginItems().existingReference != nil 9 | } 10 | 11 | func itemReferencesInLoginItems() -> (existingReference: LSSharedFileListItem?, lastReference: LSSharedFileListItem?) { 12 | let loginItemsRef = LSSharedFileListCreate(nil, kLSSharedFileListSessionLoginItems.takeRetainedValue(), nil).takeRetainedValue() 13 | 14 | guard let loginItems = LSSharedFileListCopySnapshot(loginItemsRef, nil).takeRetainedValue() as? [LSSharedFileListItem], 15 | let lastItemRef = loginItems.last else { 16 | return (nil, nil) 17 | } 18 | 19 | let appURL = NSURL.fileURL(withPath: Bundle.main.bundlePath) as NSURL 20 | let currentItemRef = loginItems.first { currentItemRef in 21 | if let itemURL = url(currentItemRef) { 22 | return itemURL.isEqual(appURL) 23 | } 24 | return false 25 | } 26 | 27 | return (currentItemRef, lastItemRef) 28 | } 29 | 30 | func toggleLaunchAtStartup() { 31 | let itemReferences = itemReferencesInLoginItems() 32 | let appUrl = NSURL.fileURL(withPath: Bundle.main.bundlePath) 33 | let loginItemsRef = LSSharedFileListCreate(nil, kLSSharedFileListSessionLoginItems.takeRetainedValue(), nil).takeRetainedValue() 34 | 35 | guard let existingReference = itemReferences.existingReference else { 36 | if let lastReference = itemReferences.lastReference { 37 | LSSharedFileListInsertItemURL(loginItemsRef, lastReference, nil, nil, appUrl as CFURL, nil, nil) 38 | } 39 | return 40 | } 41 | 42 | if let itemURL = url(existingReference) { 43 | LSSharedFileListItemRemove(loginItemsRef, get(item: itemURL)) 44 | } 45 | } 46 | 47 | // MARK - Private functions 48 | 49 | private func get(item byURL: NSURL) -> LSSharedFileListItem? { 50 | let loginItemsRef = LSSharedFileListCreate(nil, kLSSharedFileListSessionLoginItems.takeRetainedValue(), nil).takeRetainedValue() 51 | 52 | guard let loginItems = LSSharedFileListCopySnapshot(loginItemsRef, nil).takeRetainedValue() as? [LSSharedFileListItem] else { 53 | return nil 54 | } 55 | 56 | let item = loginItems.first { currentItemRef in 57 | if let itemURL = url(currentItemRef) { 58 | return itemURL.isEqual(byURL) 59 | } 60 | return false 61 | } 62 | return item 63 | } 64 | 65 | private func url(_ item: LSSharedFileListItem?) -> NSURL? { 66 | var error: Unmanaged? = nil 67 | let ret = LSSharedFileListItemCopyResolvedURL(item, 0, &error) 68 | if error == nil { 69 | return ret!.takeRetainedValue() as NSURL 70 | } 71 | // Normally: Error Domain=NSCocoaErrorDomain Code=4 "The file doesn’t exist." 72 | return nil 73 | } 74 | 75 | -------------------------------------------------------------------------------- /Overkill/OverkillController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OverkillController.swift 3 | // Overkill 4 | // 5 | // Created by Felix Krause on 8/12/17. 6 | // Copyright © 2017 Felix Krause. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class OverkillController: NSObject { 12 | 13 | // MARK - Properties 14 | 15 | private let USERDEFAULTSPROCESSNAMES = "blacklistedProcessNames" 16 | private let USERDEFAULTSFIRSTTIME = "firstLaunchForOverkill" 17 | 18 | @IBOutlet weak var statusMenu: NSMenu! { 19 | didSet { 20 | statusMenu.delegate = self 21 | statusItem.menu = statusMenu 22 | } 23 | } 24 | @IBOutlet weak var pauseButton: NSMenuItem! 25 | @IBOutlet weak var startAtLoginMenuItem: NSMenuItem! 26 | 27 | private var overkillIsPaused = false 28 | 29 | private lazy var preferencesWindow: PreferencesWindow = { 30 | let preferencesWindow = PreferencesWindow() 31 | preferencesWindow.blackListedProcessNames = blackListedProcessNames 32 | preferencesWindow.showWindow(nil) 33 | preferencesWindow.delegate = self 34 | preferencesWindow.window?.makeKeyAndOrderFront(self) 35 | return preferencesWindow 36 | }() 37 | 38 | private lazy var statusItem: NSStatusItem = { 39 | let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) 40 | let icon = NSImage(named: "statusIcon") 41 | icon?.isTemplate = true 42 | statusItem.image = icon 43 | 44 | return statusItem 45 | }() 46 | 47 | private lazy var blackListedProcessNames: [String] = { 48 | guard let blackListedProcessNames = UserDefaults.standard.array(forKey: USERDEFAULTSPROCESSNAMES) as? [String] else { 49 | return ["com.apple.iTunes", "com.apple.Music"] 50 | } 51 | return blackListedProcessNames 52 | }() 53 | 54 | // MARK - Lifecycle 55 | 56 | override func awakeFromNib() { 57 | startListening() 58 | configure() 59 | } 60 | 61 | // MARK: - Actions 62 | 63 | @IBAction func didClickPreferences(_ sender: Any) { 64 | showPreferences() 65 | } 66 | 67 | @IBAction func didClickExit(_ sender: Any) { 68 | NSApplication.shared.terminate(self) 69 | } 70 | 71 | @IBAction func didClickPause(_ sender: Any) { 72 | overkillIsPaused = !overkillIsPaused 73 | 74 | if (overkillIsPaused) { 75 | stopListening() 76 | pauseButton.title = "Resume Overkill" 77 | } else { 78 | startListening() 79 | pauseButton.title = "Pause Overkill" 80 | } 81 | } 82 | 83 | @IBAction func didClickStartAtLogin(_ sender: NSMenuItem) { 84 | toggleLaunchAtStartup() 85 | refreshStartAtLoginState() 86 | } 87 | 88 | // MARK: - Private functions 89 | 90 | private func startListening() { 91 | let notificationCenter = NSWorkspace.shared.notificationCenter 92 | notificationCenter.addObserver(self, selector: #selector(appWillLaunch(notification:)), 93 | name: NSWorkspace.willLaunchApplicationNotification, 94 | object: nil) 95 | 96 | killRunningApps() 97 | } 98 | 99 | private func stopListening() { 100 | let notificationCenter = NSWorkspace.shared.notificationCenter 101 | notificationCenter.removeObserver(self, name: NSWorkspace.willLaunchApplicationNotification, object: nil) 102 | } 103 | 104 | private func killRunningApps() { 105 | let runningApplications = NSWorkspace.shared.runningApplications 106 | for currentApplication in runningApplications.enumerated() { 107 | let runningApplication = runningApplications[currentApplication.offset] 108 | 109 | if (runningApplication.activationPolicy == .regular) { // normal macOS application 110 | if (blackListedProcessNames.contains(runningApplication.bundleIdentifier!)) { 111 | killProcess(Int(runningApplication.processIdentifier)) 112 | } 113 | } 114 | } 115 | } 116 | 117 | @objc private func appWillLaunch(notification: Notification) { 118 | if let processBundleIdentifier: String = notification.userInfo?["NSApplicationBundleIdentifier"] as? String { // the bundle identifier 119 | if let processId = notification.userInfo?["NSApplicationProcessIdentifier"] as? Int { // the pid 120 | if (blackListedProcessNames.contains(processBundleIdentifier)) { 121 | killProcess(processId) 122 | } 123 | } 124 | } 125 | } 126 | 127 | private func killProcess(_ processId: Int) { 128 | if let process = NSRunningApplication.init(processIdentifier: pid_t(processId)) { 129 | print("Killing \(processId): \(String(describing: process.localizedName!))") 130 | process.forceTerminate() 131 | } 132 | } 133 | 134 | private func configure() { 135 | if !UserDefaults.standard.bool(forKey: USERDEFAULTSFIRSTTIME) { 136 | UserDefaults.standard.set(true, forKey: USERDEFAULTSFIRSTTIME) 137 | refreshStartAtLoginState() 138 | showPreferences() 139 | } 140 | } 141 | 142 | private func showPreferences() { 143 | if !isPreferencesVisible() { 144 | preferencesWindow.showWindow(self) 145 | preferencesWindow.update(startAtLoginButton: applicationIsInStartUpItems() ? .on : .off) 146 | return 147 | } 148 | } 149 | 150 | private func isPreferencesVisible() -> Bool { 151 | return preferencesWindow.window?.occlusionState.contains(.visible) ?? false 152 | } 153 | 154 | private func refreshStartAtLoginState() { 155 | let state: NSControl.StateValue = applicationIsInStartUpItems() ? .on : .off 156 | startAtLoginMenuItem.state = state 157 | preferencesWindow.update(startAtLoginButton: state) 158 | } 159 | } 160 | 161 | extension OverkillController: PreferencesWindowDelegate { 162 | func preferencesDidUpdate(blackListedProcessNames: Array) { 163 | self.blackListedProcessNames = blackListedProcessNames 164 | UserDefaults.standard.setValue(blackListedProcessNames, forKey: USERDEFAULTSPROCESSNAMES) 165 | killRunningApps() 166 | } 167 | 168 | func preferencesDidUpdateAutoLaunch() { 169 | toggleLaunchAtStartup() 170 | refreshStartAtLoginState() 171 | } 172 | } 173 | 174 | extension OverkillController: NSMenuDelegate { 175 | func menuNeedsUpdate(_ menu: NSMenu) { 176 | startAtLoginMenuItem.state = applicationIsInStartUpItems() ? .on : .off 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /Overkill/PreferencesWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PreferencesWindow.swift 3 | // Overkill 4 | // 5 | // Created by Felix Krause on 8/12/17. 6 | // Copyright © 2017 Felix Krause. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | protocol PreferencesWindowDelegate { 12 | func preferencesDidUpdate(blackListedProcessNames: [String]) 13 | func preferencesDidUpdateAutoLaunch() 14 | } 15 | 16 | class PreferencesWindow: NSWindowController { 17 | 18 | // MARK - Properties 19 | 20 | @IBOutlet weak var applicationsTableView: NSTableView! 21 | @IBOutlet weak var startAtLoginButton: NSButton! 22 | 23 | var blackListedProcessNames = [String]() 24 | var delegate: PreferencesWindowDelegate? 25 | 26 | // MARK - Lifecycle 27 | 28 | override var windowNibName: String! { 29 | return "PreferencesWindow" 30 | } 31 | 32 | override func windowDidLoad() { 33 | super.windowDidLoad() 34 | window?.center() 35 | window?.makeKeyAndOrderFront(nil) 36 | NSApp.activate(ignoringOtherApps: true) 37 | } 38 | 39 | override func cancelOperation(_ sender: Any?) { 40 | close() 41 | } 42 | 43 | // MARK: - Public methods 44 | 45 | func update(startAtLoginButton state: NSControl.StateValue) { 46 | startAtLoginButton.state = state 47 | } 48 | 49 | // MARK: - Actions 50 | 51 | @IBAction func didClickDone(_ sender: Any) { 52 | close() 53 | } 54 | 55 | @IBAction func didClickPlusButton(_ sender: Any) { 56 | let dialog = NSOpenPanel() 57 | 58 | dialog.directoryURL = URL(string: "/Applications") 59 | dialog.title = "Choose an application" 60 | dialog.showsResizeIndicator = true 61 | dialog.showsHiddenFiles = false 62 | dialog.canChooseDirectories = false 63 | dialog.allowsMultipleSelection = false 64 | dialog.allowedFileTypes = ["app"] 65 | 66 | if (dialog.runModal() == .OK) { 67 | let result = dialog.url // Pathname of the file 68 | 69 | if (result != nil) { 70 | var fullPath = (result!.absoluteString) + "/Contents/Info.plist" 71 | fullPath = fullPath.replacingOccurrences(of: "file://", with: "").removingPercentEncoding! 72 | let content = NSDictionary(contentsOfFile: fullPath) 73 | let bundleIdentifier = content?.value(forKey: "CFBundleIdentifier") as! String 74 | if (bundleIdentifier == "com.krausefx.Overkill") { 75 | let alert = NSAlert() 76 | alert.messageText = "Ouch..." 77 | alert.informativeText = "Somewhere in the world, a Nokia phone just dropped... on another Nokia phone" 78 | alert.alertStyle = .informational 79 | alert.addButton(withTitle: "OK, I feel ashamed, I'm sorry") 80 | alert.runModal() 81 | } else { 82 | blackListedProcessNames.append(bundleIdentifier) 83 | } 84 | } 85 | } 86 | 87 | applicationsTableView.reloadData() 88 | delegate?.preferencesDidUpdate(blackListedProcessNames: blackListedProcessNames) 89 | } 90 | 91 | @IBAction func didClickMinusButton(_ sender: Any) { 92 | if (applicationsTableView.selectedRow >= 0) { 93 | blackListedProcessNames.remove(at: applicationsTableView.selectedRow) 94 | } 95 | 96 | applicationsTableView.reloadData() 97 | delegate?.preferencesDidUpdate(blackListedProcessNames: blackListedProcessNames) 98 | } 99 | 100 | @IBAction func didClickStartAtLogin(_ sender: NSButton) { 101 | delegate?.preferencesDidUpdateAutoLaunch() 102 | } 103 | 104 | @IBAction func didClickKrauseFxBestButtonIsBestButton(_ sender: Any) { 105 | if let url = URL(string: "https://twitter.com/KrauseFx") { 106 | NSWorkspace.shared.open(url) 107 | } 108 | } 109 | @IBAction func didClickOnDaniel(_ sender: Any) { 110 | if let url = URL(string: "https://twitter.com/danielsinger") { 111 | NSWorkspace.shared.open(url) 112 | } 113 | } 114 | } 115 | 116 | extension PreferencesWindow: NSTableViewDataSource { 117 | func numberOfRows(in tableView: NSTableView) -> Int { 118 | return blackListedProcessNames.count 119 | } 120 | } 121 | 122 | extension PreferencesWindow: NSTableViewDelegate { 123 | func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { 124 | guard let identifier = tableColumn?.identifier.rawValue, 125 | let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: identifier), owner: self) as? NSTableCellView else { 126 | return nil 127 | } 128 | cell.textField?.stringValue = identifier == "AutomaticTableColumnIdentifier.0" ? blackListedProcessNames[row] : "" 129 | return cell 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /Overkill/PreferencesWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 86 | 90 | 91 | 92 | 93 | 94 | 95 | 106 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 175 | 186 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Overkill for Mac 2 | 3 | [![Twitter: @KrauseFx](https://img.shields.io/badge/contact-@KrauseFx-blue.svg?style=flat)](https://twitter.com/KrauseFx) 4 | [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/KrauseFx/watch.user/blob/master/LICENSE) 5 | 6 | ## Introduction 7 | 8 | Overkill is a simple, elegant Mac app, that runs in the background and makes sure iTunes never interrupts your work. 9 | And for those movie nights where you actually want to use iTunes, just click on `Pause Overkill` and enjoy the evening. 10 | 11 | If you have other apps you don’t want to launch automatically (e.g. Photos app), you can add those apps to the Overkill list as well. 12 | 13 | ### [Read announcement on krausefx.com](https://krausefx.com/blog/introducing-overkill-dont-let-itunes-interrupt-your-workflow) 14 | 15 | ![Overkill for Mac](https://raw.githubusercontent.com/KrauseFx/krausefx.com/master/assets/posts/overkill.png 'Overkill for Mac') 16 | 17 | ## Features 18 | 19 | - Runs silently in the background, and kills iTunes 20 | - Easily pause Overkill if you want to use iTunes 21 | - Support for both Dark and Light mode of the menu bar 22 | - Supports auto start 23 | - Supports any Mac app, e.g. add the Photos app to be killed also 24 | - No CPU usage, no polling, no analytics, just 300 lines of native Mac code 25 | 26 | ## Installation 27 | 28 | Just download Overkill from the [link](https://github.com/KrauseFx/overkill-for-mac/releases/download/1.0/Overkill.zip), double click the Overkill icon, and you’re good to go! 29 | 30 | Also, you can install using Homebrew: 31 | 32 | ``` 33 | brew cask install overkill 34 | ``` 35 | 36 | ## Credits 37 | 38 | - [tombonez/noTunes](https://github.com/tombonez/noTunes) 39 | - [JellyB1/Overkill-OSX](https://github.com/JellyB1/Overkill-OSX) 40 | 41 | ## License 42 | 43 | **Overkill for Mac** is 100% open source under the MIT license. 44 | --------------------------------------------------------------------------------