wallpapers WIP

This commit is contained in:
Benjamin Palko 2025-09-18 08:37:56 -04:00
parent 3a67bc5204
commit 450ff7a503
3 changed files with 43 additions and 0 deletions

View file

@ -112,6 +112,12 @@ StyledPanelWindow {
title: "Styling"
view: StylingView {}
}
ConfigurationView {
icon: Styling.lucide.icons.swatchBook
title: "Wallpapers"
view: Wallpaper {}
}
}
component ConfigurationView: QtObject {

View file

@ -0,0 +1,13 @@
import qs.services
import QtQuick
import QtQuick.Layouts
ColumnLayout {
Repeater {
model: WallpaperService.files
delegate: Text {
required property string dataModel
text: dataModel
}
}
}

View file

@ -0,0 +1,24 @@
pragma Singleton
import Quickshell
import Quickshell.Io
Singleton {
id: root
property string directory: "~/Wallpapers/"
property list<url> files: []
property list<string> fileTypes: ["jpg", "jpeg", "png"]
Process {
running: true
command: ["bash", "-c", `find "$dir" -maxdepth 1 -type f & inotifywait -m -r ${root.directory} -e modify,move,create,delete | while read dir action; do find "$dir" -maxdepth 1 -type f; done`]
stderr: StdioCollector {
onStreamFinished: console.log(`line read: ${this.text}`)
}
stdout: SplitParser {
splitMarker: "\n"
onRead: data => root.files = data?.split("\n") ?? []
}
}
}