mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
macos fixes
This commit is contained in:
parent
f277cc0a37
commit
ee41792491
4 changed files with 34 additions and 13 deletions
|
@ -380,6 +380,11 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
|||
|
||||
ExternalTerminalType ALACRITTY_MACOS = new MacOsType("app.alacrittyMacOs", "Alacritty") {
|
||||
|
||||
@Override
|
||||
public boolean supportsColoredTitle() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void launch(LaunchConfiguration configuration) throws Exception {
|
||||
LocalStore.getShell()
|
||||
|
@ -395,16 +400,36 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
|||
|
||||
ExternalTerminalType KITTY_MACOS = new MacOsType("app.kittyMacOs", "kitty") {
|
||||
|
||||
@Override
|
||||
public boolean supportsColoredTitle() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void launch(LaunchConfiguration configuration) throws Exception {
|
||||
try (ShellControl pc = new LocalStore().control().start()) {
|
||||
pc.command(String.format(
|
||||
if (!MacOsPermissions.waitForAccessibilityPermissions()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try (ShellControl pc = LocalStore.getShell()) {
|
||||
pc.osascriptCommand(String.format(
|
||||
"""
|
||||
%s/Contents/MacOS/kitty -T "%s" %s
|
||||
""",
|
||||
getApplicationPath().orElseThrow(),
|
||||
configuration.getTitle(),
|
||||
pc.getShellDialect().fileArgument(configuration.getScriptFile())))
|
||||
if application "Kitty" is running then
|
||||
tell application "Kitty" to activate
|
||||
tell application "System Events" to tell process "Kitty" to keystroke "t" using command down
|
||||
else
|
||||
tell application "Kitty" to activate
|
||||
end if
|
||||
delay 1
|
||||
tell application "System Events"
|
||||
tell process "Kitty"
|
||||
keystroke "%s"
|
||||
delay 0.01
|
||||
key code 36
|
||||
end tell
|
||||
end tell
|
||||
""",
|
||||
configuration.getScriptFile().replaceAll("\"", "\\\\\"")))
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ terminalErrorOccured=A terminal error occured
|
|||
errorTypeOccured=An exception of type $TYPE$ was thrown
|
||||
permissionsAlertTitle=Permissions required
|
||||
permissionsAlertHeader=Additional permissions are required to perform this operation.
|
||||
permissionsAlertContent=Please follow the pop-up to give XPipe the required permissions in the privacy settings menu.
|
||||
permissionsAlertContent=Please follow the pop-up to give XPipe the required permissions in the settings menu.
|
||||
errorDetails=Show details
|
||||
target=Target
|
||||
data=Data
|
||||
|
|
|
@ -13,10 +13,6 @@
|
|||
-fx-spacing: 0.8em;
|
||||
}
|
||||
|
||||
.store-header-bar > .top {
|
||||
-fx-font-weight: BOLD;
|
||||
}
|
||||
|
||||
.root.nord .store-header-bar {
|
||||
-fx-background-radius: 0;
|
||||
-fx-border-radius: 0;
|
||||
|
|
|
@ -218,7 +218,7 @@ public sealed interface OsType permits OsType.Windows, OsType.Linux, OsType.MacO
|
|||
@Override
|
||||
public Map<String, String> getProperties(ShellControl pc) throws Exception {
|
||||
try (CommandControl c =
|
||||
pc.subShell(ShellDialects.BASH).command("sw_vers").start()) {
|
||||
pc.command("sw_vers").start()) {
|
||||
var text = c.readStdoutOrThrow();
|
||||
return PropertiesFormatsParser.parse(text, ":");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue