wallpapers: watch wallpaper dir for changes

This commit is contained in:
2 * r + 2 * t 2025-06-27 22:11:10 +10:00
parent 8689ea423a
commit 06ffd6d767

View file

@ -103,11 +103,26 @@ Singleton {
}
}
Process {
id: watchWallsProc
running: true
command: ["inotifywait", "-r", "-e", "close_write,moved_to,create", "-m", Config.paths.wallpaperDir]
stdout: SplitParser {
onRead: data => {
if (root.extensions.includes(data.slice(data.lastIndexOf(".") + 1)))
getWallsProc.running = true;
}
}
}
Connections {
target: Config.paths
function onWallpaperDirChanged(): void {
getWallsProc.running = true;
watchWallsProc.running = false;
watchWallsProc.running = true;
}
}