wallpapers: watch wallpaper dir for changes
This commit is contained in:
parent
8689ea423a
commit
06ffd6d767
1 changed files with 15 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue