From 7f0372a4d5b559b499edfa1fd5b3d9cad28ad6aa Mon Sep 17 00:00:00 2001 From: crschnick Date: Mon, 6 Feb 2023 12:52:28 +0000 Subject: [PATCH] Small fixes --- .../main/java/io/xpipe/app/core/AppStyle.java | 4 +-- .../io/xpipe/app/prefs/SupportedLocale.java | 4 +-- .../extension/util/DesktopShortcuts.java | 28 +++++-------------- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/core/AppStyle.java b/app/src/main/java/io/xpipe/app/core/AppStyle.java index d7df43ba..8d0c0a7b 100644 --- a/app/src/main/java/io/xpipe/app/core/AppStyle.java +++ b/app/src/main/java/io/xpipe/app/core/AppStyle.java @@ -146,8 +146,8 @@ public class AppStyle { @AllArgsConstructor @Getter public enum Theme implements PrefsChoiceValue { - LIGHT("light"), - DARK("dark"); + LIGHT("light"); + // DARK("dark"); private final String id; diff --git a/app/src/main/java/io/xpipe/app/prefs/SupportedLocale.java b/app/src/main/java/io/xpipe/app/prefs/SupportedLocale.java index c32c12d1..8a824203 100644 --- a/app/src/main/java/io/xpipe/app/prefs/SupportedLocale.java +++ b/app/src/main/java/io/xpipe/app/prefs/SupportedLocale.java @@ -9,8 +9,8 @@ import java.util.Locale; @AllArgsConstructor @Getter public enum SupportedLocale implements PrefsChoiceValue { - ENGLISH(Locale.ENGLISH, "english"), - GERMAN(Locale.GERMAN, "german"); + ENGLISH(Locale.ENGLISH, "english"); + //GERMAN(Locale.GERMAN, "german"); private final Locale locale; private final String id; diff --git a/extension/src/main/java/io/xpipe/extension/util/DesktopShortcuts.java b/extension/src/main/java/io/xpipe/extension/util/DesktopShortcuts.java index 359ebc0f..904de7a1 100644 --- a/extension/src/main/java/io/xpipe/extension/util/DesktopShortcuts.java +++ b/extension/src/main/java/io/xpipe/extension/util/DesktopShortcuts.java @@ -52,41 +52,27 @@ public class DesktopShortcuts { open %s """, target); - var iconScriptContent = String.format( - """ - iconSource="%s" - iconDestination="%s" - icon=/tmp/`basename $iconSource` - rsrc=/tmp/icon.rsrc - cp "$iconSource" "$icon" - sips -i "$icon" - DeRez -only icns "$icon" > "$rsrc" - SetFile -a C "$iconDestination" - touch $iconDestination/$'Icon\\r' - Rez -append $rsrc -o $iconDestination/Icon? - SetFile -a V $iconDestination/Icon? - """, - icon, base); - + try (var pc = ShellStore.local().create().start()) { - pc.executeSimpleCommand(pc.getShellType().flatten(pc.getShellType().getMkdirsCommand(base + "/Contents/MacOS"))); + pc.executeSimpleCommand( + pc.getShellType().flatten(pc.getShellType().getMkdirsCommand(base + "/Contents/MacOS"))); var executable = base + "/Contents/MacOS/" + name; pc.executeSimpleCommand(pc.getShellType().getTextFileWriteCommand(content, executable)); pc.executeSimpleCommand("chmod ugo+x \"" + executable + "\""); pc.executeSimpleCommand(pc.getShellType().getTextFileWriteCommand("APPL????", base + "/PkgInfo")); - pc.executeSimpleCommand(iconScriptContent); + pc.executeSimpleCommand("cp \"" + icon + "\" \"" + base + "/Contents/Resources/" + name + ".icns\""); } } public static void create(String target, String name) throws Exception { if (OsType.getLocal().equals(OsType.WINDOWS)) { - createWindowsShortcut(target, name); + createWindowsShortcut(target, name); } else if (OsType.getLocal().equals(OsType.LINUX)) { - createLinuxShortcut(target, name); + createLinuxShortcut(target, name); } else { - createMacOSShortcut(target, name); + createMacOSShortcut(target, name); } } }