mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-25 01:45:37 +00:00
AppImage fixes [stage]
This commit is contained in:
@@ -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 >/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 >/dev/null 2>&1 & disown";
|
||||
} else if (OsType.ofLocal() == OsType.LINUX) {
|
||||
return "nohup \"" + loc.getDaemonExecutablePath() + "\"" + suffix + " </dev/null >/dev/null 2>&1 & disown";
|
||||
} else if (OsType.ofLocal() == OsType.MACOS) {
|
||||
return "(sleep 1;open \"" + loc.getBaseInstallationPath() + "\" --args" + suffix
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+2
-1
@@ -146,4 +146,5 @@ scoop=Scoop
|
||||
vsCodium=VSCodium
|
||||
freeRdp=FreeRDP
|
||||
tailscale=Tailscale
|
||||
netbird=Netbird
|
||||
netbird=Netbird
|
||||
appImageDist=AppImage
|
||||
Reference in New Issue
Block a user