diff --git a/MTMR/ShellScriptTouchBarItem.swift b/MTMR/ShellScriptTouchBarItem.swift index 13da0cc..668a4e3 100644 --- a/MTMR/ShellScriptTouchBarItem.swift +++ b/MTMR/ShellScriptTouchBarItem.swift @@ -78,7 +78,11 @@ class ShellScriptTouchBarItem: CustomButtonTouchBarItem { func execute(_ command: String) -> String { let task = Process() - task.launchPath = "/bin/bash" + if let shell = getenv("SHELL") { + task.launchPath = String.init(cString: shell) + } else { + task.launchPath = "/bin/bash" + } task.arguments = ["-c", command] let pipe = Pipe() diff --git a/MTMR/SwipeItem.swift b/MTMR/SwipeItem.swift index baf7949..3142eca 100644 --- a/MTMR/SwipeItem.swift +++ b/MTMR/SwipeItem.swift @@ -51,7 +51,11 @@ class SwipeItem: NSCustomTouchBarItem { if scriptBash != nil { DispatchQueue.shellScriptQueue.async { let task = Process() - task.launchPath = "/bin/bash" + if let shell = getenv("SHELL") { + task.launchPath = String.init(cString: shell) + } else { + task.launchPath = "/bin/bash" + } task.arguments = ["-c", self.scriptBash!] task.launch() task.waitUntilExit()