1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-10 00:58:37 +00:00

Added shell detection

This commit is contained in:
Vini Dalvino 2022-01-27 16:04:40 -05:00
parent d199bbd852
commit 05fda273cd
2 changed files with 10 additions and 2 deletions

View File

@ -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()

View File

@ -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()