diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-19 19:44:40 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-19 19:44:40 +1000 |
| commit | 65b4b1a050b0fb8e52bb66ae6836bbc1b7706473 (patch) | |
| tree | 85ef258ecd35b18bab65f1c7b93a9af4714def66 | |
| parent | session: fix logout button (diff) | |
| download | caelestia-shell-65b4b1a050b0fb8e52bb66ae6836bbc1b7706473.tar.gz caelestia-shell-65b4b1a050b0fb8e52bb66ae6836bbc1b7706473.tar.bz2 caelestia-shell-65b4b1a050b0fb8e52bb66ae6836bbc1b7706473.zip | |
internal: make wallpaper dir configurable
| -rw-r--r-- | config/Config.qml | 2 | ||||
| -rw-r--r-- | config/UserPaths.qml | 6 | ||||
| -rw-r--r-- | services/Wallpapers.qml | 6 |
3 files changed, 11 insertions, 3 deletions
diff --git a/config/Config.qml b/config/Config.qml index 2e1e48b..e7da4bd 100644 --- a/config/Config.qml +++ b/config/Config.qml @@ -14,6 +14,7 @@ Singleton { property alias notifs: adapter.notifs property alias osd: adapter.osd property alias session: adapter.session + property alias paths: adapter.paths FileView { path: `${Paths.config}/shell.json` @@ -31,6 +32,7 @@ Singleton { property JsonObject notifs: NotifsConfig {} property JsonObject osd: OsdConfig {} property JsonObject session: SessionConfig {} + property JsonObject paths: UserPaths {} } } } diff --git a/config/UserPaths.qml b/config/UserPaths.qml new file mode 100644 index 0000000..f530d9e --- /dev/null +++ b/config/UserPaths.qml @@ -0,0 +1,6 @@ +import "root:/utils" +import Quickshell.Io + +JsonObject { + property string wallpaperDir: Paths.strip(`${Paths.pictures}/Wallpapers`) +} diff --git a/services/Wallpapers.qml b/services/Wallpapers.qml index fc965e5..1470648 100644 --- a/services/Wallpapers.qml +++ b/services/Wallpapers.qml @@ -1,5 +1,6 @@ pragma Singleton +import "root:/config" import "root:/utils/scripts/fuzzysort.js" as Fuzzy import "root:/utils" import Quickshell @@ -9,8 +10,7 @@ import QtQuick Singleton { id: root - readonly property string currentNamePath: `${Paths.state}/wallpaper/path.txt`.slice(7) - readonly property string path: `${Paths.pictures}/Wallpapers`.slice(7) + readonly property string currentNamePath: Paths.strip(`${Paths.state}/wallpaper/path.txt`) readonly property list<string> extensions: ["jpg", "jpeg", "png", "webp", "tif", "tiff"] readonly property list<Wallpaper> list: wallpapers.instances @@ -93,7 +93,7 @@ Singleton { Process { 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 { onStreamFinished: wallpapers.model = text.trim().split("\n").filter(w => root.extensions.includes(w.slice(w.lastIndexOf(".") + 1))).sort() } |