mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-02 10:41:40 +12:00
MacOS permission fixes
This commit is contained in:
parent
675cd69332
commit
b851c1da11
3 changed files with 12 additions and 5 deletions
|
@ -1,13 +1,20 @@
|
|||
package io.xpipe.app.util;
|
||||
|
||||
import io.xpipe.core.store.ShellStore;
|
||||
import io.xpipe.extension.util.ThreadHelper;
|
||||
|
||||
public class MacOsPermissions {
|
||||
|
||||
public static boolean waitFor() throws Exception {
|
||||
public static boolean waitForAccessibilityPermissions() throws Exception {
|
||||
try (var pc = ShellStore.local().create().start()) {
|
||||
pc.executeSimpleCommand("tell application \"System Events\" to keystroke \"t\"");
|
||||
}
|
||||
while (true) {
|
||||
var success = pc.executeBooleanSimpleCommand("osascript -e 'tell application \"System Events\" to keystroke \"t\"'");
|
||||
if (success) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ThreadHelper.sleep(1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -224,7 +224,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
|||
|
||||
@Override
|
||||
public void launch(String name, String command) throws Exception {
|
||||
MacOsPermissions.waitFor();
|
||||
MacOsPermissions.waitForAccessibilityPermissions();
|
||||
|
||||
try (ShellProcessControl pc = ShellStore.local().create().start()) {
|
||||
var cmd = String.format(
|
||||
|
|
|
@ -90,7 +90,7 @@ key=Key
|
|||
installConnector=Install Connector
|
||||
konsole=Konsole
|
||||
xfce=Xfce
|
||||
macosTerminal=Terminal
|
||||
macosTerminal=Terminal.app
|
||||
iterm2=iTerm2
|
||||
warp=Warp
|
||||
custom=Custom
|
Loading…
Reference in a new issue