mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-04 11:41:32 +12:00
Small fixes
This commit is contained in:
parent
03c4025c07
commit
7f0372a4d5
3 changed files with 11 additions and 25 deletions
|
@ -146,8 +146,8 @@ public class AppStyle {
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Getter
|
@Getter
|
||||||
public enum Theme implements PrefsChoiceValue {
|
public enum Theme implements PrefsChoiceValue {
|
||||||
LIGHT("light"),
|
LIGHT("light");
|
||||||
DARK("dark");
|
// DARK("dark");
|
||||||
|
|
||||||
private final String id;
|
private final String id;
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ import java.util.Locale;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Getter
|
@Getter
|
||||||
public enum SupportedLocale implements PrefsChoiceValue {
|
public enum SupportedLocale implements PrefsChoiceValue {
|
||||||
ENGLISH(Locale.ENGLISH, "english"),
|
ENGLISH(Locale.ENGLISH, "english");
|
||||||
GERMAN(Locale.GERMAN, "german");
|
//GERMAN(Locale.GERMAN, "german");
|
||||||
|
|
||||||
private final Locale locale;
|
private final Locale locale;
|
||||||
private final String id;
|
private final String id;
|
||||||
|
|
|
@ -52,41 +52,27 @@ public class DesktopShortcuts {
|
||||||
open %s
|
open %s
|
||||||
""",
|
""",
|
||||||
target);
|
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()) {
|
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;
|
var executable = base + "/Contents/MacOS/" + name;
|
||||||
pc.executeSimpleCommand(pc.getShellType().getTextFileWriteCommand(content, executable));
|
pc.executeSimpleCommand(pc.getShellType().getTextFileWriteCommand(content, executable));
|
||||||
pc.executeSimpleCommand("chmod ugo+x \"" + executable + "\"");
|
pc.executeSimpleCommand("chmod ugo+x \"" + executable + "\"");
|
||||||
|
|
||||||
pc.executeSimpleCommand(pc.getShellType().getTextFileWriteCommand("APPL????", base + "/PkgInfo"));
|
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 {
|
public static void create(String target, String name) throws Exception {
|
||||||
if (OsType.getLocal().equals(OsType.WINDOWS)) {
|
if (OsType.getLocal().equals(OsType.WINDOWS)) {
|
||||||
createWindowsShortcut(target, name);
|
createWindowsShortcut(target, name);
|
||||||
} else if (OsType.getLocal().equals(OsType.LINUX)) {
|
} else if (OsType.getLocal().equals(OsType.LINUX)) {
|
||||||
createLinuxShortcut(target, name);
|
createLinuxShortcut(target, name);
|
||||||
} else {
|
} else {
|
||||||
createMacOSShortcut(target, name);
|
createMacOSShortcut(target, name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue