mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-05-03 11:20:34 +00:00
[stage]
This commit is contained in:
@@ -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]
|
||||
|
||||
Vendored
+1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user