mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-05-19 13:58:37 -04:00
Browser improvements
This commit is contained in:
@@ -2,6 +2,7 @@ package io.xpipe.core.process;
|
||||
|
||||
import io.xpipe.core.impl.FileNames;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -33,6 +34,8 @@ public sealed interface OsType permits OsType.Windows, OsType.Linux, OsType.MacO
|
||||
return FileNames.join(getXPipeHomeDirectory(pc), "system_id");
|
||||
}
|
||||
|
||||
List<String> determineInterestingPaths(ShellControl pc) throws Exception;
|
||||
|
||||
String getHomeDirectory(ShellControl pc) throws Exception;
|
||||
|
||||
String getFileSystemSeparator();
|
||||
@@ -47,6 +50,12 @@ public sealed interface OsType permits OsType.Windows, OsType.Linux, OsType.MacO
|
||||
|
||||
static final class Windows implements OsType {
|
||||
|
||||
@Override
|
||||
public List<String> determineInterestingPaths(ShellControl pc) throws Exception {
|
||||
var home = getHomeDirectory(pc);
|
||||
return List.of(FileNames.join(home, "Desktop"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHomeDirectory(ShellControl pc) throws Exception {
|
||||
return pc.executeSimpleStringCommand(
|
||||
@@ -99,6 +108,12 @@ public sealed interface OsType permits OsType.Windows, OsType.Linux, OsType.MacO
|
||||
|
||||
static final class Linux implements OsType {
|
||||
|
||||
@Override
|
||||
public List<String> determineInterestingPaths(ShellControl pc) throws Exception {
|
||||
var home = getHomeDirectory(pc);
|
||||
return List.of(FileNames.join(home, "Desktop"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHomeDirectory(ShellControl pc) throws Exception {
|
||||
return pc.executeSimpleStringCommand(pc.getShellDialect().getPrintEnvironmentVariableCommand("HOME"));
|
||||
@@ -162,6 +177,12 @@ public sealed interface OsType permits OsType.Windows, OsType.Linux, OsType.MacO
|
||||
|
||||
static final class MacOs implements OsType {
|
||||
|
||||
@Override
|
||||
public List<String> determineInterestingPaths(ShellControl pc) throws Exception {
|
||||
var home = getHomeDirectory(pc);
|
||||
return List.of(FileNames.join(home, "Desktop"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHomeDirectory(ShellControl pc) throws Exception {
|
||||
return pc.executeSimpleStringCommand(pc.getShellDialect().getPrintEnvironmentVariableCommand("HOME"));
|
||||
|
||||
Reference in New Issue
Block a user