diff --git a/app/src/main/java/io/xpipe/app/core/AppRestart.java b/app/src/main/java/io/xpipe/app/core/AppRestart.java index 0bb6705ee..0c618a945 100644 --- a/app/src/main/java/io/xpipe/app/core/AppRestart.java +++ b/app/src/main/java/io/xpipe/app/core/AppRestart.java @@ -4,6 +4,8 @@ import io.xpipe.app.core.mode.AppOperationMode; import io.xpipe.app.process.LocalShell; import io.xpipe.app.process.ShellDialect; import io.xpipe.app.process.ShellDialects; +import io.xpipe.app.update.AppDistributionType; +import io.xpipe.app.util.DesktopShortcuts; import io.xpipe.core.OsType; import java.util.List; @@ -15,7 +17,10 @@ public class AppRestart { ? AppInstallation.ofDefault() : AppInstallation.ofCurrent(); var suffix = (arguments.size() > 0 ? " " + String.join(" ", arguments) : ""); - if (OsType.ofLocal() == OsType.LINUX) { + if (AppDistributionType.get() == AppDistributionType.APP_IMAGE) { + var exec = System.getenv("APPIMAGE"); + return "nohup \"" + exec + "\"" + suffix + " /dev/null 2>&1 & disown"; + } else if (OsType.ofLocal() == OsType.LINUX) { var exec = loc.getCliExecutablePath(); return "\"" + exec + "\" open" + suffix; } else if (OsType.ofLocal() == OsType.MACOS) { @@ -40,7 +45,10 @@ public class AppRestart { ? AppInstallation.ofDefault() : AppInstallation.ofCurrent(); var suffix = (arguments.size() > 0 ? " " + String.join(" ", arguments) : ""); - if (OsType.ofLocal() == OsType.LINUX) { + if (AppDistributionType.get() == AppDistributionType.APP_IMAGE) { + var exec = System.getenv("APPIMAGE"); + return "nohup \"" + exec + "\"" + suffix + " /dev/null 2>&1 & disown"; + } else if (OsType.ofLocal() == OsType.LINUX) { return "nohup \"" + loc.getDaemonExecutablePath() + "\"" + suffix + " /dev/null 2>&1 & disown"; } else if (OsType.ofLocal() == OsType.MACOS) { return "(sleep 1;open \"" + loc.getBaseInstallationPath() + "\" --args" + suffix diff --git a/app/src/main/java/io/xpipe/app/prefs/WorkspaceCreationDialog.java b/app/src/main/java/io/xpipe/app/prefs/WorkspaceCreationDialog.java index cad7f4a79..71e9cdf0b 100644 --- a/app/src/main/java/io/xpipe/app/prefs/WorkspaceCreationDialog.java +++ b/app/src/main/java/io/xpipe/app/prefs/WorkspaceCreationDialog.java @@ -8,6 +8,7 @@ import io.xpipe.app.core.AppProperties; import io.xpipe.app.core.mode.AppOperationMode; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.platform.OptionsBuilder; +import io.xpipe.app.update.AppDistributionType; import io.xpipe.app.util.*; import io.xpipe.core.OsType; @@ -63,6 +64,16 @@ public class WorkspaceCreationDialog { shortcutName); } default -> { + // AppImages are mounted and can't be called normally + if (AppDistributionType.get() == AppDistributionType.APP_IMAGE) { + var exec = System.getenv("APPIMAGE"); + yield DesktopShortcuts.create( + exec, + "-Dio.xpipe.app.dataDir=\"" + path.get() + + "\" -Dio.xpipe.app.acceptEula=true", + shortcutName); + } + var exec = AppInstallation.ofCurrent() .getCliExecutablePath() .toString(); diff --git a/app/src/main/java/io/xpipe/app/update/AppDistributionType.java b/app/src/main/java/io/xpipe/app/update/AppDistributionType.java index e92a5d704..07debd576 100644 --- a/app/src/main/java/io/xpipe/app/update/AppDistributionType.java +++ b/app/src/main/java/io/xpipe/app/update/AppDistributionType.java @@ -22,6 +22,7 @@ public enum AppDistributionType implements Translatable { DEVELOPMENT("development", true, () -> new GitHubUpdater(false)), PORTABLE("portable", false, () -> new PortableUpdater(true)), NATIVE_INSTALLATION("install", true, () -> new GitHubUpdater(true)), + APP_IMAGE("appImage", false, () -> new PortableUpdater(true)), HOMEBREW("homebrew", true, () -> { var pkg = AppNames.ofCurrent().getKebapName(); return new CommandUpdater( @@ -163,6 +164,10 @@ public enum AppDistributionType implements Translatable { return SCOOP; } + if (OsType.ofLocal() == OsType.LINUX && base.toString().startsWith("/mnt") && System.getenv("APPIMAGE") != null) { + return APP_IMAGE; + } + return PORTABLE; } } diff --git a/lang/strings/fixed_en.properties b/lang/strings/fixed_en.properties index 823f19a6f..30207b575 100644 --- a/lang/strings/fixed_en.properties +++ b/lang/strings/fixed_en.properties @@ -146,4 +146,5 @@ scoop=Scoop vsCodium=VSCodium freeRdp=FreeRDP tailscale=Tailscale -netbird=Netbird \ No newline at end of file +netbird=Netbird +appImageDist=AppImage \ No newline at end of file diff --git a/version b/version index b964f1280..8b2f28016 100644 --- a/version +++ b/version @@ -1 +1 @@ -19.0-8 +19.0-9