Compare commits
2 commits
0a445eaa08
...
450ff7a503
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
450ff7a503 | ||
|
|
3a67bc5204 |
5 changed files with 48 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ import Quickshell.Wayland
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: window
|
id: window
|
||||||
|
|
||||||
default property alias content: contentItem.children
|
default property alias content: contentItem.data
|
||||||
property alias background: background
|
property alias background: background
|
||||||
required property string name
|
required property string name
|
||||||
property bool canFocus: true
|
property bool canFocus: true
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,12 @@ StyledPanelWindow {
|
||||||
title: "Styling"
|
title: "Styling"
|
||||||
view: StylingView {}
|
view: StylingView {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConfigurationView {
|
||||||
|
icon: Styling.lucide.icons.swatchBook
|
||||||
|
title: "Wallpapers"
|
||||||
|
view: Wallpaper {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
component ConfigurationView: QtObject {
|
component ConfigurationView: QtObject {
|
||||||
|
|
|
||||||
13
modules/configuration/Wallpaper.qml
Normal file
13
modules/configuration/Wallpaper.qml
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -20,15 +20,15 @@ StyledPanelWindow {
|
||||||
Visibility.powermenu = focused;
|
Visibility.powermenu = focused;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: process
|
||||||
|
}
|
||||||
|
|
||||||
WrapperItem {
|
WrapperItem {
|
||||||
id: rect
|
id: rect
|
||||||
|
|
||||||
margin: 14
|
margin: 14
|
||||||
|
|
||||||
Process {
|
|
||||||
id: process
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledListView {
|
StyledListView {
|
||||||
id: list
|
id: list
|
||||||
|
|
||||||
|
|
|
||||||
24
services/WallpaperService.qml
Normal file
24
services/WallpaperService.qml
Normal 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") ?? []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue