1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 16:02:51 -05:00

hide wallpaper engine unless they are available

This commit is contained in:
bbedward
2025-09-12 12:37:06 -04:00
parent c8cb5dc146
commit c42681b9b9
3 changed files with 104 additions and 91 deletions

View File

@@ -21,30 +21,23 @@ Item {
command: []
onExited: (code) => {
if (pendingSceneId !== "") {
const cacheHome = StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()
const baseDir = cacheHome.startsWith("file://") ? cacheHome.substring(7) : cacheHome
const outDir = baseDir + "/dankshell/we_screenshots"
const outPath = outDir + "/" + pendingSceneId + ".jpg"
Quickshell.execDetached(["mkdir", "-p", outDir])
// only spawn after killer has done its job
weProcess.command = [
"linux-wallpaperengine",
"--screen-root", monitor,
"--screenshot",
outPath,
pendingSceneId,
"--bg", pendingSceneId,
"--silent"
]
weProcess.running = true
sceneId = pendingSceneId
pendingSceneId = ""
}
}
}
function start(newSceneId) {
sceneId = newSceneId
if (sceneId === newSceneId && weProcess.running) {
return
}
pendingSceneId = newSceneId
stop()
}