This commit is contained in:
crschnick
2025-11-08 11:34:38 +00:00
parent 3d3a4b8bf5
commit 31063bbc9c
3 changed files with 22 additions and 2 deletions
@@ -1,13 +1,16 @@
package io.xpipe.app.util;
import io.xpipe.app.core.AppInstallation;
import io.xpipe.app.core.AppNames;
import io.xpipe.app.core.AppSystemInfo;
import io.xpipe.app.process.CommandBuilder;
import io.xpipe.app.process.LocalShell;
import io.xpipe.app.process.OsFileSystem;
import io.xpipe.app.update.AppDistributionType;
import io.xpipe.core.FilePath;
import io.xpipe.core.OsType;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -41,10 +44,26 @@ public class DesktopShortcuts {
return shortcutPath;
}
private static Path getOrCreateIcon() throws IOException {
if (AppDistributionType.get() != AppDistributionType.APP_IMAGE) {
return AppInstallation.ofCurrent().getLogoPath();
}
var target = AppSystemInfo.ofCurrent().getUserHome().resolve(".local", "share", "icons", "256x256", "apps");
var file = target.resolve(AppNames.ofCurrent().getKebapName() + ".png");
if (Files.exists(file)) {
return file;
}
Files.createDirectories(target);
Files.copy(AppInstallation.ofCurrent().getLogoPath(), file);
return file;
}
private static Path createLinuxShortcut(String executable, String args, String name) throws Exception {
// Linux .desktop names are very restrictive
var fixedName = name.replaceAll("[^\\w _]", "");
var icon = AppInstallation.ofCurrent().getLogoPath();
var icon = getOrCreateIcon();
var content = String.format(
"""
[Desktop Entry]
+1
View File
@@ -60,6 +60,7 @@ There is also now a checkout page for chinese users, which supports common chine
- The nixpkg package now also supports macOS
- Add option to control application behavior on system hibernation
- Add workaround when default beacon HTTP server port was not usable
- Improve reliability of session restarts when a connection was interrupted
## Fixes
+1 -1
View File
@@ -1 +1 @@
19.0-14
19.0-15