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:
parent
d199bbd852
commit
05fda273cd
@ -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()
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user