1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-30 00:12:50 -05:00

Update dms greeter to scan system & local directories

This commit is contained in:
purian23
2025-11-14 15:36:14 -05:00
parent 1c5e31fea9
commit 8f5a9d6e9f

View File

@@ -1063,14 +1063,35 @@ Item {
Process { Process {
id: sessionListProc id: sessionListProc
command: ["find"] property string homeDir: Quickshell.env("HOME") || ""
.concat("/usr/share/wayland-sessions") property string xdgDirs: xdgDataDirs || ""
.concat("/usr/share/xsessions") command: {
.concat("/usr/local/share/wayland-sessions") var paths = [
.concat("/usr/local/share/xsessions") "/usr/share/wayland-sessions",
.concat(xdgDataDirs.split(":").map(d => d + "/wayland-sessions")) "/usr/share/xsessions",
.concat(xdgDataDirs.split(":").map(d => d + "/xsessions")) "/usr/local/share/wayland-sessions",
.concat(["-name", "*.desktop", "-type", "f", "-follow"]) "/usr/local/share/xsessions"
]
if (homeDir) {
paths.push(homeDir + "/.local/share/wayland-sessions")
paths.push(homeDir + "/.local/share/xsessions")
}
// Add XDG_DATA_DIRS paths
if (xdgDirs) {
xdgDirs.split(":").forEach(function(dir) {
if (dir) {
paths.push(dir + "/wayland-sessions")
paths.push(dir + "/xsessions")
}
})
}
// 1. Explicit system/user paths
var explicitFind = "find " + paths.join(" ") + " -maxdepth 1 -name '*.desktop' -type f 2>/dev/null"
// 2. Scan all /home user directories for local session files
var homeScan = "find /home -maxdepth 4 \\( -path '*/wayland-sessions/*.desktop' -o -path '*/xsessions/*.desktop' \\) -type f 2>/dev/null"
var findCmd = "(" + explicitFind + "; " + homeScan + ") | sort -u"
return ["sh", "-c", findCmd]
}
running: false running: false
stdout: SplitParser { stdout: SplitParser {