feat: set featured wall as default if no wall set

This commit is contained in:
2 * r + 2 * t 2026-06-08 01:03:00 +10:00
parent 21a67d3671
commit 36adb25231

View file

@ -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 {