mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Improve macos shortcuts
This commit is contained in:
parent
22783c949d
commit
45b4b84bf3
2 changed files with 14 additions and 2 deletions
|
@ -37,7 +37,8 @@ public class AppPrefs {
|
||||||
private static final boolean STORAGE_DIR_FIXED =
|
private static final boolean STORAGE_DIR_FIXED =
|
||||||
!AppProperties.get().getDataDir().equals(AppProperties.DEFAULT_DATA_DIR);
|
!AppProperties.get().getDataDir().equals(AppProperties.DEFAULT_DATA_DIR);
|
||||||
private static final String LOG_LEVEL_PROP = "io.xpipe.app.logLevel";
|
private static final String LOG_LEVEL_PROP = "io.xpipe.app.logLevel";
|
||||||
private static final String DEFAULT_LOG_LEVEL = "info";
|
// Lets keep this at trace for now, at least for the alpha
|
||||||
|
private static final String DEFAULT_LOG_LEVEL = "trace";
|
||||||
private static final boolean LOG_LEVEL_FIXED = System.getProperty(LOG_LEVEL_PROP) != null;
|
private static final boolean LOG_LEVEL_FIXED = System.getProperty(LOG_LEVEL_PROP) != null;
|
||||||
private static final String DEVELOPER_MODE_PROP = "io.xpipe.app.developerMode";
|
private static final String DEVELOPER_MODE_PROP = "io.xpipe.app.developerMode";
|
||||||
private static AppPrefs INSTANCE;
|
private static AppPrefs INSTANCE;
|
||||||
|
|
|
@ -68,7 +68,18 @@ public class DesktopShortcuts {
|
||||||
Rez -append $rsrc -o $iconDestination
|
Rez -append $rsrc -o $iconDestination
|
||||||
""",
|
""",
|
||||||
icon, target);
|
icon, target);
|
||||||
ShellStore.local().create().executeSimpleCommand(iconScriptContent);
|
|
||||||
|
try (var pc = ShellStore.local().create().start()) {
|
||||||
|
var base = System.getProperty("user.home") + "/Desktop/" + name;
|
||||||
|
pc.executeSimpleCommand(pc.getShellType().flatten(pc.getShellType().getMkdirsCommand(base + "/Contents/MacOS")));
|
||||||
|
|
||||||
|
var executable = base + "/Contents/MacOS/" + name + ".sh";
|
||||||
|
pc.executeSimpleCommand(pc.getShellType().getTextFileWriteCommand(content, executable));
|
||||||
|
pc.executeSimpleCommand(pc.getShellType().getMakeExecutableCommand(executable));
|
||||||
|
|
||||||
|
pc.executeSimpleCommand(pc.getShellType().getTextFileWriteCommand("APPL??", base + "/PkgInfo"));
|
||||||
|
pc.executeSimpleCommand(iconScriptContent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void create(String target, String name) throws Exception {
|
public static void create(String target, String name) throws Exception {
|
||||||
|
|
Loading…
Reference in a new issue