summaryrefslogtreecommitdiff
path: root/services/Wallpapers.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-27 22:11:10 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-27 22:11:10 +1000
commit06ffd6d767d19b2df31d907184c410e9f1ef66fd (patch)
treef612755825b3d21dce2053b441beba0fde2d8338 /services/Wallpapers.qml
parentpicker: fix client selecting (diff)
downloadcaelestia-shell-06ffd6d767d19b2df31d907184c410e9f1ef66fd.tar.gz
caelestia-shell-06ffd6d767d19b2df31d907184c410e9f1ef66fd.tar.bz2
caelestia-shell-06ffd6d767d19b2df31d907184c410e9f1ef66fd.zip
wallpapers: watch wallpaper dir for changes
Diffstat (limited to 'services/Wallpapers.qml')
-rw-r--r--services/Wallpapers.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/services/Wallpapers.qml b/services/Wallpapers.qml
index 4bce290..eea4cb4 100644
--- a/services/Wallpapers.qml
+++ b/services/Wallpapers.qml
@@ -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;
}
}