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 list<string> smartArg: GlobalConfig.services.smartScheme ? [] : ["--no-smart"]
|
||||
readonly property string fallback: Quickshell.shellPath("assets/wallpaper.webp")
|
||||
|
||||
property bool showPreview: false
|
||||
readonly property string current: showPreview ? previewPath : actualCurrent
|
||||
|
|
@ -76,11 +77,22 @@ Searcher {
|
|||
FileView {
|
||||
path: root.currentNamePath
|
||||
watchChanges: true
|
||||
printErrors: false
|
||||
onFileChanged: reload()
|
||||
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;
|
||||
}
|
||||
onLoadFailed: {
|
||||
root.actualCurrent = root.fallback;
|
||||
root.previewColourLock = false;
|
||||
Quickshell.execDetached(["caelestia", "wallpaper", "-f", root.fallback, ...root.smartArg]);
|
||||
}
|
||||
}
|
||||
|
||||
FileSystemModel {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue