From 83ee78928b7a28327745de0dad952bf65d78906b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rene=CC=81=20Uittenbogaard?= Date: Mon, 30 Dec 2024 13:52:00 +0100 Subject: [PATCH 1/2] Added artwork --- publicity/yabai-spaceman-kaders.png | Bin 0 -> 9504 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 publicity/yabai-spaceman-kaders.png diff --git a/publicity/yabai-spaceman-kaders.png b/publicity/yabai-spaceman-kaders.png new file mode 100644 index 0000000000000000000000000000000000000000..e60817cd7093608c30c154bec2f256fbd824ac9f GIT binary patch literal 9504 zcmZ`;1z1$w(_d1WMM@B)L15`_X^>Kpmd=hiWHq+<~fRFFnWKtj4fIv44V6(pAL zqHjO{?>^7H_uM)2J9B2voVYWQkJJ_MaVT*>AP~N?lH3yz2z3xBOJZRHPqF1}Di8>r z04gi{$W~TS*3r(Ip!F6u|H=zzzQzUaoDG&{rY5VOmoh2L(k0qNYyAv~xYN`J*0VJr{1{~-q1F&lAfo#BT* z`YqRk**I~5cOO~l`{a8Bi!;<2#+pJd0zb*m+jh)`Xv9}>`;#o9)%{3ib4gha2g9_! z&$&gEaYC!Ug0C&>q1cBEAj8JbVJ8u`LrG@fn^UJUVaZx!$D z+>^Vk;W5s_aSwQsg||j{53~el<0$tzWw=+a24#!ri`B6a>^h1#t6L+pLiOL{u!f3G z4vW0Cijs!xMXwwYX%|U$=)BKKmANwJs3qxSl6Yy9h3D4I?S6?k_t42s$ATw{kmFLu zFmY+u9LjVD>eR3lfQ>)71;)eYy47ZrdQo64Fv`_ONi<2j&m=oY(_(ubw1#@`kaC+4 z%O%hfLj4R(@{4dNH*DT)ytR3A_HAirv5oa75>)&2IkJ0uV}x6#@S5RZ_(R*ijTXaa zyZ~>TV)tQeD<_6=9%U}&#E>&8`lRpN6mD#}EspC)#=TJ( zp1_2nKSytPN_QfyEz*{%hrT|934y1EriN^LlP4XFMExCfq8k;oVT}{6n{JHOl+QWb zx@X3-U52jPjMp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Pel>5+8#)ESd-j@!xF68n!`To6B>~t3=z>X%&?V)z@JMQ?xk{}+_#>pTF}(V_jGS}zG3ux>Y6^$I{(I|J}?wd=*r-V}G@>zhqK?~$ee*95K zJ=VBZ;XhL@4_3jCp2qgh^RhyI=U;v&LLQ-`(hth#mhy((o3@Yi{uwieagnyr>pfMeJ(^F^C0E}{ zFV-E^n=Q7BEO2_5#;($?@2+b2{KCB)xr-GGqdpx#u2No(R8!#dz;Wb+ zDEgw}yX(i-xU$@(bVxd+78!Edb!TedHr|S5lUnN8d%e%JT{W0gyzL>|ng`JDwJ8gC zs-&)4NU|Bziop!i*^B-n+4j=AU%V=XB|QVZ{Bqcg&$fS#T@(Ro>|gs3Af&beze;)0 zG$e-4|48NC_`?e<^ygL_|INFh#)84l4xtHy z|8fqj7nFe4`QZKOEWfjT4^V;BA8}9t04W6l&V`!rTJGO{h!EbU z_}hnnHI5C4R|h2~{yU$DLS!w0_HQY)D5%$j Date: Mon, 30 Dec 2024 14:36:45 +0100 Subject: [PATCH 2/2] Fixed specifying which permission is missing --- Spaceman.xcodeproj/project.pbxproj | 8 ++++---- Spaceman/Helpers/SpaceSwitcher.swift | 14 +++++++++----- Spaceman/Info.plist | 2 ++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Spaceman.xcodeproj/project.pbxproj b/Spaceman.xcodeproj/project.pbxproj index a328fb3..0e4cf3f 100644 --- a/Spaceman.xcodeproj/project.pbxproj +++ b/Spaceman.xcodeproj/project.pbxproj @@ -465,7 +465,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.18; + CURRENT_PROJECT_VERSION = 1.6.19; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Spaceman/Preview Content\""; DEVELOPMENT_TEAM = ""; @@ -480,7 +480,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.6.18; + MARKETING_VERSION = 1.6.19; PRODUCT_BUNDLE_IDENTIFIER = dev.ruittenb.Spaceman; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -499,7 +499,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.18; + CURRENT_PROJECT_VERSION = 1.6.19; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Spaceman/Preview Content\""; DEVELOPMENT_TEAM = ""; @@ -514,7 +514,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 1.6.18; + MARKETING_VERSION = 1.6.19; PRODUCT_BUNDLE_IDENTIFIER = dev.ruittenb.Spaceman; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Spaceman/Helpers/SpaceSwitcher.swift b/Spaceman/Helpers/SpaceSwitcher.swift index e44112f..15baf14 100644 --- a/Spaceman/Helpers/SpaceSwitcher.swift +++ b/Spaceman/Helpers/SpaceSwitcher.swift @@ -27,11 +27,15 @@ class SpaceSwitcher { if let scriptObject = NSAppleScript(source: appleScript) { scriptObject.executeAndReturnError(&error) if error != nil { + let errorNumber: Int = error?[NSAppleScript.errorNumber] as! Int let errorBriefMessage: String = error?[NSAppleScript.errorBriefMessage] as! String let settingsName = self.systemSettingsName() + // -1002: Error: Spaceman is not allowed to send keystrokes. (needs Accessibility permission) + // -1743: Error: Not authorized to send Apple events to System Events. (needs Automation permission) + let permissionType = errorNumber == 1002 ? "Accessibility" : "Automation" self.alert( - msg: "Error: \(errorBriefMessage)\n\nPlease grant Accessibility permissions to Spaceman in \(settingsName) → Privacy and Security.", - withSettingsButton: true) + msg: "Error: \(errorBriefMessage)\n\nPlease grant \(permissionType) permissions to Spaceman in \(settingsName) → Privacy and Security.", + permissionTypeName: permissionType) } } } @@ -56,13 +60,13 @@ class SpaceSwitcher { } } - private func alert(msg: String, withSettingsButton: Bool) { + private func alert(msg: String, permissionTypeName: String) { DispatchQueue.main.async { let alert = NSAlert.init() alert.messageText = "Spaceman" alert.informativeText = "\(msg)" alert.addButton(withTitle: "Dismiss") - if withSettingsButton { + if permissionTypeName != "" { let settingsName = self.systemSettingsName() alert.addButton(withTitle: "\(settingsName)...") } @@ -70,7 +74,7 @@ class SpaceSwitcher { if (response == .alertSecondButtonReturn) { let task = Process() task.launchPath = "/usr/bin/open" - task.arguments = ["x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"] + task.arguments = ["x-apple.systempreferences:com.apple.preference.security?Privacy_\(permissionTypeName)"] try? task.run() } } diff --git a/Spaceman/Info.plist b/Spaceman/Info.plist index 2a7f8f4..fe4380a 100644 --- a/Spaceman/Info.plist +++ b/Spaceman/Info.plist @@ -2,6 +2,8 @@ + NSAppleEventsUsageDescription + This app uses AppleScript to switch desktops CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName