mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Simplify warp launcher
This commit is contained in:
parent
1e7c2f9c93
commit
6ad4f990d1
1 changed files with 6 additions and 21 deletions
|
@ -563,6 +563,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
|||
}
|
||||
};
|
||||
ExternalTerminalType WARP = new MacOsType("app.warp", "Warp") {
|
||||
|
||||
@Override
|
||||
public boolean supportsTabs() {
|
||||
return true;
|
||||
|
@ -575,27 +576,11 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
|||
|
||||
@Override
|
||||
public void launch(LaunchConfiguration configuration) throws Exception {
|
||||
if (!MacOsPermissions.waitForAccessibilityPermissions()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try (ShellControl pc = LocalShell.getShell()) {
|
||||
pc.osascriptCommand(String.format(
|
||||
"""
|
||||
tell application "Warp" to activate
|
||||
tell application "System Events" to tell process "Warp" to keystroke "t" using command down
|
||||
delay 1
|
||||
tell application "System Events"
|
||||
tell process "Warp"
|
||||
keystroke "%s"
|
||||
delay 0.01
|
||||
key code 36
|
||||
end tell
|
||||
end tell
|
||||
""",
|
||||
configuration.getScriptFile().replaceAll("\"", "\\\\\"")))
|
||||
.execute();
|
||||
}
|
||||
LocalShell.getShell()
|
||||
.executeSimpleCommand(CommandBuilder.of()
|
||||
.add("open", "-a")
|
||||
.addQuoted("Warp.app")
|
||||
.addFile(configuration.getScriptFile()));
|
||||
}
|
||||
};
|
||||
ExternalTerminalType TABBY_MAC_OS = new MacOsType("app.tabby", "Tabby") {
|
||||
|
|
Loading…
Reference in a new issue