diff --git a/app/src/main/java/io/xpipe/app/util/DesktopHelper.java b/app/src/main/java/io/xpipe/app/util/DesktopHelper.java index 190c20088..f3e99c20a 100644 --- a/app/src/main/java/io/xpipe/app/util/DesktopHelper.java +++ b/app/src/main/java/io/xpipe/app/util/DesktopHelper.java @@ -1,9 +1,11 @@ package io.xpipe.app.util; import io.xpipe.app.issue.ErrorEvent; +import io.xpipe.core.process.CommandBuilder; import io.xpipe.core.process.OsType; import io.xpipe.core.process.ShellControl; import io.xpipe.core.store.FileKind; +import io.xpipe.core.store.FilePath; import java.awt.*; import java.nio.file.Files; @@ -64,7 +66,13 @@ public class DesktopHelper { dbus-send --session --print-reply --dest=org.freedesktop.FileManager1 --type=method_call /org/freedesktop/FileManager1 %s array:string:"file://%s" string:"" """, action, path); - sc.executeSimpleCommand(dbus); + var success = sc.executeSimpleBooleanCommand(dbus); + if (success) { + return; + } + + var file = new FilePath(path); + sc.command(CommandBuilder.of().add("xdg-open").addFile(kind == FileKind.DIRECTORY ? file : file.getParent())).execute(); } case OsType.MacOs macOs -> { sc.executeSimpleCommand("open " + (kind == FileKind.DIRECTORY ? "" : "-R ") + d.fileArgument(path)); diff --git a/ext/base/src/main/java/io/xpipe/ext/base/browser/OpenNativeFileDetailsAction.java b/ext/base/src/main/java/io/xpipe/ext/base/browser/OpenNativeFileDetailsAction.java index baf38b205..c1e1de19b 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/browser/OpenNativeFileDetailsAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/browser/OpenNativeFileDetailsAction.java @@ -5,10 +5,13 @@ import io.xpipe.app.browser.file.BrowserEntry; import io.xpipe.app.browser.fs.OpenFileSystemModel; import io.xpipe.app.core.AppI18n; import io.xpipe.app.util.LocalShell; +import io.xpipe.core.process.CommandBuilder; import io.xpipe.core.process.OsType; import io.xpipe.core.process.ShellControl; +import io.xpipe.core.store.FileKind; import io.xpipe.core.store.FileNames; +import io.xpipe.core.store.FilePath; import javafx.beans.value.ObservableValue; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; @@ -47,10 +50,16 @@ public class OpenNativeFileDetailsAction implements LeafAction { case OsType.Linux linux -> { var dbus = String.format( """ - dbus-send --session --print-reply --dest=org.freedesktop.FileManager1 --type=method_call /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItemProperties array:string:"file://%s" string:"" - """, + dbus-send --session --print-reply --dest=org.freedesktop.FileManager1 --type=method_call /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItemProperties array:string:"file://%s" string:"" + """, localFile); - sc.executeSimpleCommand(dbus); + var success = sc.executeSimpleBooleanCommand(dbus); + if (success) { + return; + } + + var file = new FilePath(e); + sc.command(CommandBuilder.of().add("xdg-open").addFile(entry.getRawFileEntry().getKind() == FileKind.DIRECTORY ? file : file.getParent())).execute(); } case OsType.MacOs macOs -> { sc.osascriptCommand(String.format( diff --git a/gradle/gradle_scripts/vernacular-1.16.jar b/gradle/gradle_scripts/vernacular-1.16.jar index a95fe369b..6427d583b 100644 Binary files a/gradle/gradle_scripts/vernacular-1.16.jar and b/gradle/gradle_scripts/vernacular-1.16.jar differ