mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-19 22:01:12 +00:00
MacOS permission fixes
This commit is contained in:
parent
a4b3729896
commit
642d5c44ec
|
@ -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);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue