feat: set featured wall as default if no wall set
This commit is contained in:
parent
21a67d3671
commit
36adb25231
1 changed files with 13 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ Searcher {
|
||||||
|
|
||||||
readonly property string currentNamePath: `${Paths.state}/wallpaper/path.txt`
|
readonly property string currentNamePath: `${Paths.state}/wallpaper/path.txt`
|
||||||
readonly property list<string> smartArg: GlobalConfig.services.smartScheme ? [] : ["--no-smart"]
|
readonly property list<string> smartArg: GlobalConfig.services.smartScheme ? [] : ["--no-smart"]
|
||||||
|
readonly property string fallback: Quickshell.shellPath("assets/wallpaper.webp")
|
||||||
|
|
||||||
property bool showPreview: false
|
property bool showPreview: false
|
||||||
readonly property string current: showPreview ? previewPath : actualCurrent
|
readonly property string current: showPreview ? previewPath : actualCurrent
|
||||||
|
|
@ -76,11 +77,22 @@ Searcher {
|
||||||
FileView {
|
FileView {
|
||||||
path: root.currentNamePath
|
path: root.currentNamePath
|
||||||
watchChanges: true
|
watchChanges: true
|
||||||
|
printErrors: false
|
||||||
onFileChanged: reload()
|
onFileChanged: reload()
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
root.actualCurrent = text().trim();
|
let wall = text().trim();
|
||||||
|
if (!wall) {
|
||||||
|
wall = root.fallback;
|
||||||
|
Quickshell.execDetached(["caelestia", "wallpaper", "-f", root.fallback, ...root.smartArg]);
|
||||||
|
}
|
||||||
|
root.actualCurrent = wall;
|
||||||
root.previewColourLock = false;
|
root.previewColourLock = false;
|
||||||
}
|
}
|
||||||
|
onLoadFailed: {
|
||||||
|
root.actualCurrent = root.fallback;
|
||||||
|
root.previewColourLock = false;
|
||||||
|
Quickshell.execDetached(["caelestia", "wallpaper", "-f", root.fallback, ...root.smartArg]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSystemModel {
|
FileSystemModel {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue