mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-15 08:48:04 +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;
|
package io.xpipe.app.util;
|
||||||
|
|
||||||
import io.xpipe.core.store.ShellStore;
|
import io.xpipe.core.store.ShellStore;
|
||||||
|
import io.xpipe.extension.util.ThreadHelper;
|
||||||
|
|
||||||
public class MacOsPermissions {
|
public class MacOsPermissions {
|
||||||
|
|
||||||
public static boolean waitFor() throws Exception {
|
public static boolean waitForAccessibilityPermissions() throws Exception {
|
||||||
try (var pc = ShellStore.local().create().start()) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThreadHelper.sleep(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void launch(String name, String command) throws Exception {
|
public void launch(String name, String command) throws Exception {
|
||||||
MacOsPermissions.waitFor();
|
MacOsPermissions.waitForAccessibilityPermissions();
|
||||||
|
|
||||||
try (ShellProcessControl pc = ShellStore.local().create().start()) {
|
try (ShellProcessControl pc = ShellStore.local().create().start()) {
|
||||||
var cmd = String.format(
|
var cmd = String.format(
|
||||||
|
|
|
@ -90,7 +90,7 @@ key=Key
|
||||||
installConnector=Install Connector
|
installConnector=Install Connector
|
||||||
konsole=Konsole
|
konsole=Konsole
|
||||||
xfce=Xfce
|
xfce=Xfce
|
||||||
macosTerminal=Terminal
|
macosTerminal=Terminal.app
|
||||||
iterm2=iTerm2
|
iterm2=iTerm2
|
||||||
warp=Warp
|
warp=Warp
|
||||||
custom=Custom
|
custom=Custom
|
Loading…
Reference in a new issue