Skip to content

Commit bdf9bec

Browse files
committed
Add missing app name helper
1 parent 8bfffaa commit bdf9bec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ax/Sources/AXHelper/main.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ func checkAccessibilityPermissions() {
6060
}
6161
}
6262

63+
// Helper function to get the name of the parent process
64+
func getParentProcessName() -> String? {
65+
let parentPid = getppid() // Get parent process ID
66+
if let parentApp = NSRunningApplication(processIdentifier: parentPid) {
67+
return parentApp.localizedName ?? parentApp.bundleIdentifier
68+
}
69+
return nil
70+
}
71+
6372
// MARK: - Codable command envelopes -------------------------------------------------
6473

6574
struct CommandEnvelope: Codable {

0 commit comments

Comments
 (0)