diff --git a/DockPhobia.xcodeproj/project.pbxproj b/DockPhobia.xcodeproj/project.pbxproj index 4ab4cbe..1d77c7d 100644 --- a/DockPhobia.xcodeproj/project.pbxproj +++ b/DockPhobia.xcodeproj/project.pbxproj @@ -6,33 +6,22 @@ objectVersion = 77; objects = { -/* Begin PBXCopyFilesBuildPhase section */ - A98E7EA02D836FBB0004DA00 /* Embed XPC Services */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "$(CONTENTS_FOLDER_PATH)/XPCServices"; - dstSubfolderSpec = 16; - files = ( - ); - name = "Embed XPC Services"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ +/* Begin PBXBuildFile section */ + A966B4F42DE0842500C721A5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A966B4EE2DE0842400C721A5 /* AppDelegate.swift */; }; + A966B4F52DE0842500C721A5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A966B4EF2DE0842400C721A5 /* Assets.xcassets */; }; + A966B4F62DE0842500C721A5 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = A966B4F22DE0842400C721A5 /* MainMenu.xib */; }; +/* End PBXBuildFile section */ /* Begin PBXFileReference section */ - A91E849D2D82CF4100FC2E5F /* DockPhobia.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DockPhobia.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A966B4D62DE0841000C721A5 /* DockPhobia.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DockPhobia.app; sourceTree = BUILT_PRODUCTS_DIR; }; + A966B4EE2DE0842400C721A5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + A966B4EF2DE0842400C721A5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + A966B4F02DE0842400C721A5 /* DockPhobia.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DockPhobia.entitlements; sourceTree = ""; }; + A966B4F12DE0842400C721A5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; /* End PBXFileReference section */ -/* Begin PBXFileSystemSynchronizedRootGroup section */ - A91E849F2D82CF4100FC2E5F /* DockPhobia */ = { - isa = PBXFileSystemSynchronizedRootGroup; - path = DockPhobia; - sourceTree = ""; - }; -/* End PBXFileSystemSynchronizedRootGroup section */ - /* Begin PBXFrameworksBuildPhase section */ - A91E849A2D82CF4100FC2E5F /* Frameworks */ = { + A966B4D32DE0841000C721A5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( @@ -42,104 +31,125 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - A91E84942D82CF4100FC2E5F = { + A966B4CD2DE0841000C721A5 = { isa = PBXGroup; children = ( - A91E849F2D82CF4100FC2E5F /* DockPhobia */, - A91E849E2D82CF4100FC2E5F /* Products */, + A966B4F32DE0842400C721A5 /* DockPhobia */, + A966B4D72DE0841000C721A5 /* Products */, ); sourceTree = ""; }; - A91E849E2D82CF4100FC2E5F /* Products */ = { + A966B4D72DE0841000C721A5 /* Products */ = { isa = PBXGroup; children = ( - A91E849D2D82CF4100FC2E5F /* DockPhobia.app */, + A966B4D62DE0841000C721A5 /* DockPhobia.app */, ); name = Products; sourceTree = ""; }; + A966B4F32DE0842400C721A5 /* DockPhobia */ = { + isa = PBXGroup; + children = ( + A966B4EE2DE0842400C721A5 /* AppDelegate.swift */, + A966B4EF2DE0842400C721A5 /* Assets.xcassets */, + A966B4F02DE0842400C721A5 /* DockPhobia.entitlements */, + A966B4F22DE0842400C721A5 /* MainMenu.xib */, + ); + path = DockPhobia; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - A91E849C2D82CF4100FC2E5F /* DockPhobia */ = { + A966B4D52DE0841000C721A5 /* DockPhobia */ = { isa = PBXNativeTarget; - buildConfigurationList = A91E84C22D82CF4300FC2E5F /* Build configuration list for PBXNativeTarget "DockPhobia" */; + buildConfigurationList = A966B4E32DE0841200C721A5 /* Build configuration list for PBXNativeTarget "DockPhobia" */; buildPhases = ( - A91E84992D82CF4100FC2E5F /* Sources */, - A91E849A2D82CF4100FC2E5F /* Frameworks */, - A91E849B2D82CF4100FC2E5F /* Resources */, - A98E7EA02D836FBB0004DA00 /* Embed XPC Services */, + A966B4D22DE0841000C721A5 /* Sources */, + A966B4D32DE0841000C721A5 /* Frameworks */, + A966B4D42DE0841000C721A5 /* Resources */, ); buildRules = ( ); dependencies = ( ); - fileSystemSynchronizedGroups = ( - A91E849F2D82CF4100FC2E5F /* DockPhobia */, - ); name = DockPhobia; packageProductDependencies = ( ); productName = DockPhobia; - productReference = A91E849D2D82CF4100FC2E5F /* DockPhobia.app */; + productReference = A966B4D62DE0841000C721A5 /* DockPhobia.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - A91E84952D82CF4100FC2E5F /* Project object */ = { + A966B4CE2DE0841000C721A5 /* Project object */ = { isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1620; - LastUpgradeCheck = 1620; + LastSwiftUpdateCheck = 1640; + LastUpgradeCheck = 1640; TargetAttributes = { - A91E849C2D82CF4100FC2E5F = { - CreatedOnToolsVersion = 16.2; + A966B4D52DE0841000C721A5 = { + CreatedOnToolsVersion = 16.4; }; }; }; - buildConfigurationList = A91E84982D82CF4100FC2E5F /* Build configuration list for PBXProject "DockPhobia" */; + buildConfigurationList = A966B4D12DE0841000C721A5 /* Build configuration list for PBXProject "DockPhobia" */; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = A91E84942D82CF4100FC2E5F; + mainGroup = A966B4CD2DE0841000C721A5; minimizedProjectReferenceProxies = 1; preferredProjectObjectVersion = 77; - productRefGroup = A91E849E2D82CF4100FC2E5F /* Products */; + productRefGroup = A966B4D72DE0841000C721A5 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - A91E849C2D82CF4100FC2E5F /* DockPhobia */, + A966B4D52DE0841000C721A5 /* DockPhobia */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - A91E849B2D82CF4100FC2E5F /* Resources */ = { + A966B4D42DE0841000C721A5 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A966B4F52DE0842500C721A5 /* Assets.xcassets in Resources */, + A966B4F62DE0842500C721A5 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - A91E84992D82CF4100FC2E5F /* Sources */ = { + A966B4D22DE0841000C721A5 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A966B4F42DE0842500C721A5 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXVariantGroup section */ + A966B4F22DE0842400C721A5 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + A966B4F12DE0842400C721A5 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ - A91E84C02D82CF4300FC2E5F /* Debug */ = { + A966B4E12DE0841200C721A5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -174,6 +184,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 8JGND254B7; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -192,7 +203,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 15.2; + MACOSX_DEPLOYMENT_TARGET = 15.5; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -202,7 +213,7 @@ }; name = Debug; }; - A91E84C12D82CF4300FC2E5F /* Release */ = { + A966B4E22DE0841200C721A5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -237,6 +248,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 8JGND254B7; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -249,7 +261,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MACOSX_DEPLOYMENT_TARGET = 15.2; + MACOSX_DEPLOYMENT_TARGET = 15.5; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; @@ -257,69 +269,57 @@ }; name = Release; }; - A91E84C32D82CF4300FC2E5F /* Debug */ = { + A966B4E42DE0841200C721A5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; CODE_SIGN_ENTITLEMENTS = DockPhobia/DockPhobia.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"DockPhobia/Preview Content\""; - DEVELOPMENT_TEAM = P6PV2R9443; - ENABLE_APP_SANDBOX = NO; - ENABLE_HARDENED_RUNTIME = NO; - ENABLE_PREVIEWS = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; + DEVELOPMENT_TEAM = 8JGND254B7; + ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = DockPhobia/Info.plist; - INFOPLIST_KEY_LSUIElement = NO; - INFOPLIST_KEY_NSAppleEventsUsageDescription = "Needed to send AppleScript to move the Dock"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INFOPLIST_KEY_NSMainNibFile = MainMenu; + INFOPLIST_KEY_NSPrincipalClass = NSApplication; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13; - MARKETING_VERSION = 2.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.DockPhobia; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.neon443.DockPhobia; PRODUCT_NAME = "$(TARGET_NAME)"; + REGISTER_APP_GROUPS = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; }; name = Debug; }; - A91E84C42D82CF4300FC2E5F /* Release */ = { + A966B4E52DE0841200C721A5 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; CODE_SIGN_ENTITLEMENTS = DockPhobia/DockPhobia.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"DockPhobia/Preview Content\""; - DEVELOPMENT_TEAM = P6PV2R9443; - ENABLE_APP_SANDBOX = NO; - ENABLE_HARDENED_RUNTIME = NO; - ENABLE_PREVIEWS = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; + DEVELOPMENT_TEAM = 8JGND254B7; + ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = DockPhobia/Info.plist; - INFOPLIST_KEY_LSUIElement = NO; - INFOPLIST_KEY_NSAppleEventsUsageDescription = "Needed to send AppleScript to move the Dock"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INFOPLIST_KEY_NSMainNibFile = MainMenu; + INFOPLIST_KEY_NSPrincipalClass = NSApplication; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 13; - MARKETING_VERSION = 2.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.neon443.DockPhobia; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.neon443.DockPhobia; PRODUCT_NAME = "$(TARGET_NAME)"; + REGISTER_APP_GROUPS = YES; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; }; @@ -328,25 +328,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - A91E84982D82CF4100FC2E5F /* Build configuration list for PBXProject "DockPhobia" */ = { + A966B4D12DE0841000C721A5 /* Build configuration list for PBXProject "DockPhobia" */ = { isa = XCConfigurationList; buildConfigurations = ( - A91E84C02D82CF4300FC2E5F /* Debug */, - A91E84C12D82CF4300FC2E5F /* Release */, + A966B4E12DE0841200C721A5 /* Debug */, + A966B4E22DE0841200C721A5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - A91E84C22D82CF4300FC2E5F /* Build configuration list for PBXNativeTarget "DockPhobia" */ = { + A966B4E32DE0841200C721A5 /* Build configuration list for PBXNativeTarget "DockPhobia" */ = { isa = XCConfigurationList; buildConfigurations = ( - A91E84C32D82CF4300FC2E5F /* Debug */, - A91E84C42D82CF4300FC2E5F /* Release */, + A966B4E42DE0841200C721A5 /* Debug */, + A966B4E52DE0841200C721A5 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = A91E84952D82CF4100FC2E5F /* Project object */; + rootObject = A966B4CE2DE0841000C721A5 /* Project object */; } diff --git a/DockPhobia.xcodeproj/xcshareddata/xcschemes/DockPhobia.xcscheme b/DockPhobia.xcodeproj/xcshareddata/xcschemes/DockPhobia.xcscheme deleted file mode 100644 index 3becac0..0000000 --- a/DockPhobia.xcodeproj/xcshareddata/xcschemes/DockPhobia.xcscheme +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DockPhobia.xcodeproj/xcuserdata/neon443.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/DockPhobia.xcodeproj/xcuserdata/neon443.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index 5418eea..0000000 --- a/DockPhobia.xcodeproj/xcuserdata/neon443.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/DockPhobia.xcodeproj/xcuserdata/neon443.xcuserdatad/xcschemes/xcschememanagement.plist b/DockPhobia.xcodeproj/xcuserdata/neon443.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 0df0b42..0000000 --- a/DockPhobia.xcodeproj/xcuserdata/neon443.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - SchemeUserState - - DockPhobia.xcscheme_^#shared#^_ - - orderHint - 0 - - - SuppressBuildableAutocreation - - A91E849C2D82CF4100FC2E5F - - primary - - - A91E84AD2D82CF4300FC2E5F - - primary - - - A91E84B72D82CF4300FC2E5F - - primary - - - - - diff --git a/DockPhobia.xcworkspace/contents.xcworkspacedata b/DockPhobia.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 4e7ae3c..0000000 --- a/DockPhobia.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/DockPhobia.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/DockPhobia.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 0c67376..0000000 --- a/DockPhobia.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/DockPhobia.xcworkspace/xcuserdata/neon443.xcuserdatad/WorkspaceSettings.xcsettings b/DockPhobia.xcworkspace/xcuserdata/neon443.xcuserdatad/WorkspaceSettings.xcsettings deleted file mode 100644 index f1ebe29..0000000 --- a/DockPhobia.xcworkspace/xcuserdata/neon443.xcuserdatad/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,18 +0,0 @@ - - - - - BuildLocationStyle - UseAppPreferences - CustomBuildIntermediatesPath - Build/Intermediates.noindex - CustomBuildLocationType - RelativeToDerivedData - CustomBuildProductsPath - Build/Products - DerivedDataLocationStyle - Default - ShowSharedSchemesAutomaticallyEnabled - - - diff --git a/DockPhobia.xcworkspace/xcuserdata/neon443.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/DockPhobia.xcworkspace/xcuserdata/neon443.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index 61c124a..0000000 --- a/DockPhobia.xcworkspace/xcuserdata/neon443.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/DockPhobia/.DS_Store b/DockPhobia/.DS_Store index 2860a77..5c86e02 100644 Binary files a/DockPhobia/.DS_Store and b/DockPhobia/.DS_Store differ diff --git a/DockPhobia/AppDelegate.swift b/DockPhobia/AppDelegate.swift new file mode 100644 index 0000000..ee07d18 --- /dev/null +++ b/DockPhobia/AppDelegate.swift @@ -0,0 +1,30 @@ +// +// AppDelegate.swift +// DockPhobia +// +// Created by neon443 on 23/05/2025. +// + +import Cocoa + +@main +class AppDelegate: NSObject, NSApplicationDelegate { + + @IBOutlet var window: NSWindow! + + + func applicationDidFinishLaunching(_ aNotification: Notification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } + + func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } + + +} + diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/Contents.json b/DockPhobia/Assets.xcassets/AppIcon.appiconset/Contents.json index 6815a88..3f00db4 100644 --- a/DockPhobia/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/DockPhobia/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,61 +1,51 @@ { "images" : [ { - "filename" : "DockPhobiaAppIcon 16.png", "idiom" : "mac", "scale" : "1x", "size" : "16x16" }, { - "filename" : "DockPhobiaAppIcon 33.png", "idiom" : "mac", "scale" : "2x", "size" : "16x16" }, { - "filename" : "DockPhobiaAppIcon 32.png", "idiom" : "mac", "scale" : "1x", "size" : "32x32" }, { - "filename" : "DockPhobiaAppIcon 64.png", "idiom" : "mac", "scale" : "2x", "size" : "32x32" }, { - "filename" : "DockPhobiaAppIcon 128.png", "idiom" : "mac", "scale" : "1x", "size" : "128x128" }, { - "filename" : "DockPhobiaAppIcon 256.png", "idiom" : "mac", "scale" : "2x", "size" : "128x128" }, { - "filename" : "DockPhobiaAppIcon 257.png", "idiom" : "mac", "scale" : "1x", "size" : "256x256" }, { - "filename" : "DockPhobiaAppIcon 512.png", "idiom" : "mac", "scale" : "2x", "size" : "256x256" }, { - "filename" : "DockPhobiaAppIcon 513.png", "idiom" : "mac", "scale" : "1x", "size" : "512x512" }, { - "filename" : "DockPhobiaAppIcon 1024.png", "idiom" : "mac", "scale" : "2x", "size" : "512x512" diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 1024.png b/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 1024.png deleted file mode 100644 index 6705458..0000000 Binary files a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 1024.png and /dev/null differ diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 128.png b/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 128.png deleted file mode 100644 index 848acd0..0000000 Binary files a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 128.png and /dev/null differ diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 16.png b/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 16.png deleted file mode 100644 index f06dfd7..0000000 Binary files a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 16.png and /dev/null differ diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 256.png b/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 256.png deleted file mode 100644 index 9eef0a3..0000000 Binary files a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 256.png and /dev/null differ diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 257.png b/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 257.png deleted file mode 100644 index 9eef0a3..0000000 Binary files a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 257.png and /dev/null differ diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 32.png b/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 32.png deleted file mode 100644 index 130c065..0000000 Binary files a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 32.png and /dev/null differ diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 33.png b/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 33.png deleted file mode 100644 index 130c065..0000000 Binary files a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 33.png and /dev/null differ diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 512.png b/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 512.png deleted file mode 100644 index 3490ef4..0000000 Binary files a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 512.png and /dev/null differ diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 513.png b/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 513.png deleted file mode 100644 index 3490ef4..0000000 Binary files a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 513.png and /dev/null differ diff --git a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 64.png b/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 64.png deleted file mode 100644 index e6c7370..0000000 Binary files a/DockPhobia/Assets.xcassets/AppIcon.appiconset/DockPhobiaAppIcon 64.png and /dev/null differ diff --git a/DockPhobia/Base.lproj/MainMenu.xib b/DockPhobia/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..6daa64d --- /dev/null +++ b/DockPhobia/Base.lproj/MainMenu.xib @@ -0,0 +1,698 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DockPhobia/ContentView.swift b/DockPhobia/ContentView.swift deleted file mode 100644 index f4f81e5..0000000 --- a/DockPhobia/ContentView.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// ContentView.swift -// DockPhobia -// -// Created by neon443 on 13/03/2025. -// - -//import SwiftUI -// -//struct ContentView: View { -// -//} -// -//#Preview { -// ContentView(isTracking: .constant(true)) -//} diff --git a/DockPhobia/DockPhobia.entitlements b/DockPhobia/DockPhobia.entitlements index 2527cd0..18aff0c 100644 --- a/DockPhobia/DockPhobia.entitlements +++ b/DockPhobia/DockPhobia.entitlements @@ -2,13 +2,9 @@ - com.apple.security.temporary-exception.apple-events - - System Events - - com.apple.security.temporary-exception.mach-lookup.global-name - - com.apple.tsm.portname - + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + diff --git a/DockPhobia/DockPhobiaApp.swift b/DockPhobia/DockPhobiaApp.swift deleted file mode 100644 index 765e584..0000000 --- a/DockPhobia/DockPhobiaApp.swift +++ /dev/null @@ -1,349 +0,0 @@ -// -// DockPhobiaApp.swift -// DockPhobia -// -// Created by neon443 on 13/03/2025. -// - -import Foundation -import SwiftUI -import Cocoa -import CoreGraphics - -//@main -//struct DockPhobiaApp: App { -// @State var enabled: Bool = true -// var body: some Scene { -// WindowGroup { -// ContentView(enabled: $enabled) -// } -// MenuBarExtra( -// "Menu Bar", -// systemImage: "cursorarrow\(enabled ? "" : ".slash")" -// ) { -// -// Button("One") { -// enabled.toggle() -// } -// .keyboardShortcut("1") -//// ContentView(enabled: $enabled) -//// .frame(width: 300, height: 200) -// } -// .menuBarExtraStyle(.window) -// } -//// NSEvent.addGlobalMonitorForEvents(matching: [.mouseMoved]) { event in -//// print("event:", event) -//// } -// -//} -////struct DockPhobiaApp: App { -//// var body: some Scene { -//// WindowGroup { -//// ContentView() -//// } -//// } -////} -import Foundation - -@main -struct DockPhobiaApp: App { - enum DockPosition: String { - case left - case right - case bottom - } - - @State var preferencesOpen: Bool = false - @State var isTracking: Bool = false - func toggleTracking() { - if isTracking { - stopTrackingMouse() - } else { - startTrackingMouse() - } - isTracking.toggle() - } - var body: some Scene { - // WindowGroup { - // ContentView(isTracking: $isTracking) - // } - MenuBarExtra("Dock Phobia", systemImage: "cursorarrow\(isTracking ? "" : ".slash")") { - Text(isTracking ? "Enabled" : "Disabled") - Text("\(getScreenSize())") - Button("Toggle tracking") { - toggleTracking() - } - .keyboardShortcut(" ", modifiers: []) - - Divider() - Button("Settings") { - preferencesOpen.toggle() - } - .keyboardShortcut(",") - Divider() - Button("try shell") { - print(shell("echo hello") as Any) - } - Divider() - Button("Move Dock to Right") { - moveDock("right") - } - Button("Move Dock to Left") { - moveDock("left") - } - Button("Move Dock to Bottom") { - moveDock("bottom") - } - Divider() - Button("Get Dock orientation") { - print(getDockSide()) - } - Button("Get Dock Height Percentage") { - print(getDockHeight()) - } - Divider() - Button("calcdockFromBottom") { - print(calcDockFromBottom()) - } - Button("calc dock from right") { - print(calcDockFromRight()) - } - Button("calc dock from left") { - print(calcDockFromLeft()) - } - Divider() - Button("Quit") { - NSApplication.shared.terminate(nil) - } - .keyboardShortcut("q") - } - } -} - -func shell(_ command: String) -> String? { - let process = Process() - let pipe = Pipe() - let pipeError = Pipe() - - process.executableURL = URL(fileURLWithPath: "/bin/zsh") - process.arguments = ["-c", command] - process.standardOutput = pipe - process.standardError = pipeError - - let outputHandle = pipe.fileHandleForReading - let outputErrorHandle = pipeError.fileHandleForReading - - process.launch() - process.waitUntilExit() - - let data = outputHandle.readDataToEndOfFile() - let dataError = outputErrorHandle.readDataToEndOfFile() - - let output = String( - data: data, - encoding: .utf8 - )?.trimmingCharacters(in: .whitespacesAndNewlines) - let outputError = String( - data: dataError, - encoding: .utf8 - )?.trimmingCharacters(in: .whitespacesAndNewlines) - - if outputError != "" { - print(outputError as Any) - } - return output -} - -func osascript(_ script: String) -> String? { - let process = Process() - let outputPipe = Pipe() - let outputErrorPipe = Pipe() - - process.executableURL = URL(fileURLWithPath: "/usr/bin/osascript") - process.arguments = ["-e", script] - process.standardOutput = outputPipe - process.standardError = outputErrorPipe - - process.launch() -// process.waitUntilExit() - - let outputHandle = outputPipe.fileHandleForReading.readDataToEndOfFile() - let outputErrorHandle = outputErrorPipe.fileHandleForReading.readDataToEndOfFile() - - let outputData = String( - data: outputHandle, - encoding: .utf8 - )? - .trimmingCharacters( - in: .whitespacesAndNewlines - ) - let outputErrorData = String( - data: outputErrorHandle, - encoding: .utf8 - )? - .trimmingCharacters( - in: .whitespacesAndNewlines - ) - if outputErrorData != "" { - print(outputErrorData as Any) - } - return outputData -} - -func getDockSide() -> String { - let result = shell("defaults read com.apple.Dock orientation") - print("dock is on the \(result ?? "idk")") - return result ?? "unknown" -} - -// global event tap -var eventTap: CFMachPort? - -func getDockHeight() -> Double { - guard let screen = NSScreen.main else { - return 0 - } - - let dockSide = getDockSide() - let screenDimensions = getScreenSize() - let width = screenDimensions.x - let height = screenDimensions.y - let visibleHeight = screen.visibleFrame.height - - let perpendicularToDock: CGFloat - if dockSide == "bottom" { - perpendicularToDock = height - } else { - perpendicularToDock = width - } - - let dockHeight = CGFloat(height) - visibleHeight - let percentage = (dockHeight / perpendicularToDock) - return Double(percentage) -} - -func calcDockFromBottom() -> CGFloat { - let screenSize = getScreenSize() - let dockHeight = getDockHeight() - return screenSize.y - (screenSize.y * dockHeight) -} - -func calcDockFromRight() -> CGFloat { - let screenSize = getScreenSize() - let dockHeight = getDockHeight() - return screenSize.x - (screenSize.x * dockHeight) -} - -func calcDockFromLeft() -> CGFloat { - let screenSize = getScreenSize() - let dockHeight = getDockHeight() - return screenSize.x * dockHeight -} - -func startTrackingMouse() { - let mask = CGEventMask(1 << CGEventType.mouseMoved.rawValue) - var dockSide = getDockSide() - var lastMove = Date.now - //try creating event tap - eventTap = CGEvent.tapCreate( - tap: .cgSessionEventTap, - place: .headInsertEventTap, - options: CGEventTapOptions.defaultTap, - eventsOfInterest: mask, - callback: { (proxy, type, event, userInfo) -> Unmanaged? in -// let location = event.location -// print("mouse at \(location)") -// print("mouse at \(event.location)") - //TODO: add Dock moving here - var lastDockMoveTime = Date() - let debounceInterval: TimeInterval = 0.1 - if Date().timeIntervalSince(lastDockMoveTime) > debounceInterval { - if event.location.y > 1000 { - lastDockMoveTime = Date() - Task { - moveDock("left") - } - } else if event.location.x < 100 { - lastDockMoveTime = Date() - Task { - moveDock("right") - } - } else if event.location.x > 1600 { - lastDockMoveTime = Date() - Task { - moveDock("bottom") - } - } - } - return Unmanaged.passRetained(event) - }, - userInfo: nil - ) - - //event tap started checking - if let eventTap = eventTap { - let runLoopSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, eventTap, 0) - CFRunLoopAddSource(CFRunLoopGetMain(), runLoopSource, .commonModes) - CGEvent.tapEnable(tap: eventTap, enable: true) - - print(" mouse tracking started!") - } else { - print(" failed to create event tap.") - } -} - -func stopTrackingMouse() { - if let eventTap = eventTap { - // disable event tap - CGEvent.tapEnable(tap: eventTap, enable: false) - - // stops run loop - CFRunLoopPerformBlock(CFRunLoopGetMain(), CFRunLoopMode.defaultMode.rawValue) { - CFRunLoopStop(CFRunLoopGetMain()) - } - - print(" mouse tracking has stopped") - } else { - print(" no active event tap to stop") - } -} - -func getScreenSize() -> (x: CGFloat, y: CGFloat) { - let script = """ - tell application "Finder" - get bounds of window of desktop - end tell - """ - let result = osascript(script)?.dropFirst(6).split(separator: ", ") - // removes the "0, 0, " and splits into an arr - let resultTuple = ( - CGFloat( - Int( - result![0] - )! - ), - CGFloat( - Int( - result![1] - )! - ) - ) - return resultTuple -} - -func moveDock(_ to: String) { -// let validPos = ["left", "bottom", "right"] -// guard validPos.contains(to) else { -// print("invalid dock position") -// return -// } - let script = """ - tell application "System Events" - tell dock preferences - set screen edge to \(to) - end tell - end tell - """ - osascript(script) - return -} diff --git a/DockPhobia/Info.plist b/DockPhobia/Info.plist deleted file mode 100644 index 70a0ff6..0000000 --- a/DockPhobia/Info.plist +++ /dev/null @@ -1,10 +0,0 @@ - - - - - NSAppleEventsUsageDescription - allow it - com.apple.security.automation.apple-events - - - diff --git a/DockPhobia/Preview Content/Preview Assets.xcassets/Contents.json b/DockPhobia/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index 73c0059..0000000 --- a/DockPhobia/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/DockPhobiaAppIcon.pxd b/DockPhobiaAppIcon.pxd index 76f6b71..7d50729 100644 Binary files a/DockPhobiaAppIcon.pxd and b/DockPhobiaAppIcon.pxd differ