[READ-ONLY] Mirror of https://github.com/mrgnw/scripts.
0

Configure Feed

Select the types of activity you want to include in your feed.

executable is $1 or .thing

+2 -5
+2 -5
+launcher
··· 1 - #! /usr/bin/env swift 2 - // create a LaunchCTL launcher 3 1 import Foundation 4 2 5 - let executableName = ".thing" 3 + let executableName = CommandLine.arguments.count > 1 ? CommandLine.arguments[1] : ".thing" 6 4 let directoryPath = FileManager.default.currentDirectoryPath 7 5 let directoryName = URL(fileURLWithPath: directoryPath).lastPathComponent 8 6 9 - // Use the directory name to create a unique plist filename 10 7 let plistFilename = "com.user.thingLauncher.\(directoryName).plist" 11 8 let plistPath = NSString(string: "~/Library/LaunchAgents/\(plistFilename)").expandingTildeInPath 12 9 13 - // Define the dictionary for plist content 14 10 let plistDict: [String: Any] = [ 15 11 "Label": "com.user.thingLauncher.\(directoryName)", 16 12 "ProgramArguments": ["\(directoryPath)/\(executableName)"], ··· 37 33 print("LaunchAgent loaded successfully.") 38 34 } catch { 39 35 print("Error loading LaunchAgent: \(error)") 36 + exit(1) 40 37 }