Skip to content

Commit 3333c6d

Browse files
committed
Better snap compatibility
1 parent e0fa5d3 commit 3333c6d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ tasks.register("generateSnapConfiguration"){
238238
- x11
239239
- network
240240
- opengl
241+
- home
241242
242243
parts:
243244
processing:

app/src/processing/app/platform/LinuxPlatform.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333

3434

3535
public class LinuxPlatform extends DefaultPlatform {
36-
// Switched to use ~ as the home directory for compatibility with snap
37-
String homeDir = "~";
36+
String homeDir;
3837

3938

4039
public void initBase(Base base) {
@@ -107,6 +106,10 @@ public File getSettingsFolder() throws Exception {
107106
configHome = null; // don't use non-existent folder
108107
}
109108
}
109+
String snapUserCommon = System.getenv("SNAP_USER_COMMON");
110+
if (snapUserCommon != null && !snapUserCommon.isBlank()) {
111+
configHome = new File(snapUserCommon);
112+
}
110113
// If not set properly, use the default
111114
if (configHome == null) {
112115
configHome = new File(getHomeDir(), ".config");

0 commit comments

Comments
 (0)