File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/main/java/org/cryptomator/linux/autostart Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -38,16 +38,18 @@ public class FreedesktopAutoStartService implements AutoStartProvider {
38
38
39
39
private final Path autostartFile ;
40
40
private final String content ;
41
+ private final boolean hasExecValue ;
41
42
42
43
public FreedesktopAutoStartService () {
43
44
var xdgConfigDirString = Objects .requireNonNullElse (System .getenv ("XDG_CONFIG_HOME" ), System .getProperty ("user.home" ) + "/.config" );
44
45
this .autostartFile = Path .of (xdgConfigDirString , "autostart" , AUTOSTART_FILENAME );
45
46
46
47
var execValue = System .getProperty (CMD_PROPERTY );
47
48
if (execValue == null ) {
48
- LOG .debug ("Property {} not set, using command path" , CMD_PROPERTY );
49
+ LOG .debug ("JVM property {} not set, using command path" , CMD_PROPERTY );
49
50
execValue = ProcessHandle .current ().info ().command ().orElse ("" );
50
51
}
52
+ this .hasExecValue = execValue .isBlank ();
51
53
this .content = CONTENT_TEMPLATE .formatted (execValue , this .getClass ().getName ());
52
54
}
53
55
@@ -77,7 +79,7 @@ public synchronized boolean isEnabled() {
77
79
@ CheckAvailability
78
80
public boolean isSupported () {
79
81
//TODO: might need to research which Desktop Environments support this
80
- return Files .exists (autostartFile .getParent ());
82
+ return hasExecValue && Files .exists (autostartFile .getParent ());
81
83
}
82
84
83
85
}
You can’t perform that action at this time.
0 commit comments