From cc84ab2289381038f483f06963374aa0247f6724 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 2 Sep 2025 20:56:37 +0200 Subject: ... --- .../quickshell/Services/WallpaperSelector.qml | 8 ++ .../shell/quickshell/WallpaperBackground.qml | 85 ++++++++++++++++++++++ accounts/gkleen@sif/shell/quickshell/shell.qml | 23 +++++- 3 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 accounts/gkleen@sif/shell/quickshell/Services/WallpaperSelector.qml create mode 100644 accounts/gkleen@sif/shell/quickshell/WallpaperBackground.qml (limited to 'accounts/gkleen@sif/shell/quickshell') diff --git a/accounts/gkleen@sif/shell/quickshell/Services/WallpaperSelector.qml b/accounts/gkleen@sif/shell/quickshell/Services/WallpaperSelector.qml new file mode 100644 index 00000000..3c524955 --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/Services/WallpaperSelector.qml @@ -0,0 +1,8 @@ +import Custom as Custom + +Custom.FileSelector { + id: root + + directory: @wallpapers@ + epoch: 72000000 +} diff --git a/accounts/gkleen@sif/shell/quickshell/WallpaperBackground.qml b/accounts/gkleen@sif/shell/quickshell/WallpaperBackground.qml new file mode 100644 index 00000000..de31915f --- /dev/null +++ b/accounts/gkleen@sif/shell/quickshell/WallpaperBackground.qml @@ -0,0 +1,85 @@ +import QtQuick +import Quickshell +import qs.Services + +Item { + id: root + + anchors.fill: parent + + required property string screen + + property Img current: one + property string source: selector.selected + + WallpaperSelector { + id: selector + seed: screen + } + + onSourceChanged: { + if (!source) + current = null; + else if (current === one) + two.update() + else + one.update() + } + + Img { id: one } + Img { id: two } + + component Img: Image { + id: img + + function update() { + source = root.source || "" + } + + anchors.fill: parent + fillMode: Image.PreserveAspectCrop + smooth: true + asynchronous: true + cache: false + + opacity: 0 + + onStatusChanged: { + if (status === Image.Ready) { + root.current = this + } + } + + states: State { + name: "visible" + when: root.current === img + + PropertyChanges { + img.opacity: 1 + } + StateChangeScript { + name: "unloadOther" + script: { + if (img === one) + two.source = "" + if (img === two) + one.source = "" + } + } + } + + transitions: Transition { + SequentialAnimation { + NumberAnimation { + target: img + properties: "opacity" + duration: 5000 + easing.type: Easing.OutCubic + } + ScriptAction { + scriptName: "unloadOther" + } + } + } + } +} diff --git a/accounts/gkleen@sif/shell/quickshell/shell.qml b/accounts/gkleen@sif/shell/quickshell/shell.qml index 4934cd4d..2ddecad9 100644 --- a/accounts/gkleen@sif/shell/quickshell/shell.qml +++ b/accounts/gkleen@sif/shell/quickshell/shell.qml @@ -1,6 +1,7 @@ //@ pragma UseQApplication import Quickshell +import Quickshell.Wayland ShellRoot { settings.watchFiles: false @@ -13,9 +14,27 @@ ShellRoot { required property var modelData - Bar { - id: bar + PanelWindow { + id: bgWindow + + screen: screenScope.modelData + + WlrLayershell.layer: WlrLayer.Background + WlrLayershell.exclusionMode: ExclusionMode.Ignore + + anchors.top: true + anchors.bottom: true + anchors.left: true + anchors.right: true + color: "black" + + WallpaperBackground { + screen: bgWindow.screen.name + } + } + + Bar { screen: screenScope.modelData } } -- cgit v1.2.3