internal: make wallpaper dir configurable
This commit is contained in:
parent
f1ef177c9a
commit
65b4b1a050
3 changed files with 11 additions and 3 deletions
|
|
@ -14,6 +14,7 @@ Singleton {
|
||||||
property alias notifs: adapter.notifs
|
property alias notifs: adapter.notifs
|
||||||
property alias osd: adapter.osd
|
property alias osd: adapter.osd
|
||||||
property alias session: adapter.session
|
property alias session: adapter.session
|
||||||
|
property alias paths: adapter.paths
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
path: `${Paths.config}/shell.json`
|
path: `${Paths.config}/shell.json`
|
||||||
|
|
@ -31,6 +32,7 @@ Singleton {
|
||||||
property JsonObject notifs: NotifsConfig {}
|
property JsonObject notifs: NotifsConfig {}
|
||||||
property JsonObject osd: OsdConfig {}
|
property JsonObject osd: OsdConfig {}
|
||||||
property JsonObject session: SessionConfig {}
|
property JsonObject session: SessionConfig {}
|
||||||
|
property JsonObject paths: UserPaths {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
6
config/UserPaths.qml
Normal file
6
config/UserPaths.qml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
import "root:/utils"
|
||||||
|
import Quickshell.Io
|
||||||
|
|
||||||
|
JsonObject {
|
||||||
|
property string wallpaperDir: Paths.strip(`${Paths.pictures}/Wallpapers`)
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
|
import "root:/config"
|
||||||
import "root:/utils/scripts/fuzzysort.js" as Fuzzy
|
import "root:/utils/scripts/fuzzysort.js" as Fuzzy
|
||||||
import "root:/utils"
|
import "root:/utils"
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|
@ -9,8 +10,7 @@ import QtQuick
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property string currentNamePath: `${Paths.state}/wallpaper/path.txt`.slice(7)
|
readonly property string currentNamePath: Paths.strip(`${Paths.state}/wallpaper/path.txt`)
|
||||||
readonly property string path: `${Paths.pictures}/Wallpapers`.slice(7)
|
|
||||||
readonly property list<string> extensions: ["jpg", "jpeg", "png", "webp", "tif", "tiff"]
|
readonly property list<string> extensions: ["jpg", "jpeg", "png", "webp", "tif", "tiff"]
|
||||||
|
|
||||||
readonly property list<Wallpaper> list: wallpapers.instances
|
readonly property list<Wallpaper> list: wallpapers.instances
|
||||||
|
|
@ -93,7 +93,7 @@ Singleton {
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
running: true
|
running: true
|
||||||
command: ["find", root.path, "-type", "d", "-path", '*/.*', "-prune", "-o", "-not", "-name", '.*', "-type", "f", "-print"]
|
command: ["find", Config.paths.wallpaperDir, "-type", "d", "-path", '*/.*', "-prune", "-o", "-not", "-name", '.*', "-type", "f", "-print"]
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: wallpapers.model = text.trim().split("\n").filter(w => root.extensions.includes(w.slice(w.lastIndexOf(".") + 1))).sort()
|
onStreamFinished: wallpapers.model = text.trim().split("\n").filter(w => root.extensions.includes(w.slice(w.lastIndexOf(".") + 1))).sort()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue