Compare commits
No commits in common. "2aa72accda39d3f525166f32dbe1777d2ead5857" and "7ba62221053b7ea9ee56d5ca80abcb3ae795b736" have entirely different histories.
2aa72accda
...
7ba6222105
3 changed files with 26 additions and 7 deletions
|
|
@ -19,7 +19,7 @@ ListView {
|
||||||
implicitHeight: 90
|
implicitHeight: 90
|
||||||
model: FolderListModel {
|
model: FolderListModel {
|
||||||
nameFilters: ["*.jpg"]
|
nameFilters: ["*.jpg"]
|
||||||
folder: `file://${Paths.expandTilde(Config.wallpaper.directory)}`
|
folder: `${Paths.home}/Wallpapers`
|
||||||
showDirs: false
|
showDirs: false
|
||||||
}
|
}
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property alias powermenu: adapter.powermenu
|
readonly property alias powermenu: adapter.powermenu
|
||||||
readonly property alias wallpaper: adapter.wallpaper
|
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
path: `${Paths.config}/shell.json`
|
path: `${Paths.config}/shell.json`
|
||||||
|
|
@ -20,7 +19,6 @@ Singleton {
|
||||||
id: adapter
|
id: adapter
|
||||||
|
|
||||||
property var powermenu: PowerMenu {}
|
property var powermenu: PowerMenu {}
|
||||||
property var wallpaper: Wallpaper {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -32,8 +30,4 @@ Singleton {
|
||||||
property string text
|
property string text
|
||||||
property string command
|
property string command
|
||||||
}
|
}
|
||||||
|
|
||||||
component Wallpaper: JsonObject {
|
|
||||||
property string directory
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,37 @@
|
||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
import qs.config
|
import qs.config
|
||||||
|
import qs.utils
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property string directory: "~/Wallpapers/"
|
||||||
|
property alias files: properties.files
|
||||||
property alias currentWallpaper: properties.currentWallpaper
|
property alias currentWallpaper: properties.currentWallpaper
|
||||||
|
property list<string> fileTypes: ["jpg", "jpeg", "png"]
|
||||||
|
property string command: `find ${root.directory} -maxdepth 1 -type f`
|
||||||
|
|
||||||
|
Process {
|
||||||
|
running: true
|
||||||
|
command: ["bash", "-c", `find ${root.directory} -maxdepth 1 -type f`]
|
||||||
|
stdout: StdioCollector {
|
||||||
|
onStreamFinished: {
|
||||||
|
root.files = this.text.split("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DirectoryWatcher {
|
||||||
|
path: root.directory
|
||||||
|
fileFilter: ["jpg", "jpeg", "png"]
|
||||||
|
onCreated: path => root.files.push(path)
|
||||||
|
onDeleted: path => root.files.filter(file => file != path)
|
||||||
|
onMovedFrom: path => root.files.filter(file => file != path)
|
||||||
|
onMovedTo: path => path => root.files.push(path)
|
||||||
|
}
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
path: `${Paths.cache}/wallpaper.json`
|
path: `${Paths.cache}/wallpaper.json`
|
||||||
|
|
@ -22,6 +46,7 @@ Singleton {
|
||||||
id: properties
|
id: properties
|
||||||
|
|
||||||
property url currentWallpaper: ""
|
property url currentWallpaper: ""
|
||||||
|
property list<string> files: []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue