From 69adb9208723467014cf21f401f2ba1804f38376 Mon Sep 17 00:00:00 2001 From: Unrectified <83581717+Unrectified@users.noreply.github.com> Date: Thu, 19 Feb 2026 12:34:21 +0100 Subject: [PATCH] feat: add wallpaperEnabled option (#1187) * fix: change background color to none allowing other wallpaper engine and background enabled * feat: add wallpaperEnabled property and toggle in appearance settings * fix background: Make it "black" if wallpaper is enabled, otherwise "transparent" * fix: separate Visualiser from Wallpaper (hope I didn't made more shit buh) * fix: transparency not working & layer position * fix --------- Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> --- config/BackgroundConfig.qml | 1 + config/Config.qml | 1 + modules/background/Background.qml | 12 +++++++++--- modules/background/Visualiser.qml | 2 +- modules/background/Wallpaper.qml | 2 -- modules/controlcenter/appearance/AppearancePane.qml | 3 +++ .../appearance/sections/BackgroundSection.qml | 9 +++++++++ 7 files changed, 24 insertions(+), 6 deletions(-) diff --git a/config/BackgroundConfig.qml b/config/BackgroundConfig.qml index b8a8ad92..8383f524 100644 --- a/config/BackgroundConfig.qml +++ b/config/BackgroundConfig.qml @@ -2,6 +2,7 @@ import Quickshell.Io JsonObject { property bool enabled: true + property bool wallpaperEnabled: true property DesktopClock desktopClock: DesktopClock {} property Visualiser visualiser: Visualiser {} diff --git a/config/Config.qml b/config/Config.qml index 7851c3bd..1ec47c19 100644 --- a/config/Config.qml +++ b/config/Config.qml @@ -160,6 +160,7 @@ Singleton { function serializeBackground(): var { return { enabled: background.enabled, + wallpaperEnabled: background.wallpaperEnabled, desktopClock: { enabled: background.desktopClock.enabled, scale: background.desktopClock.scale, diff --git a/modules/background/Background.qml b/modules/background/Background.qml index f8484e16..682da624 100644 --- a/modules/background/Background.qml +++ b/modules/background/Background.qml @@ -22,8 +22,9 @@ Loader { screen: modelData name: "background" WlrLayershell.exclusionMode: ExclusionMode.Ignore - WlrLayershell.layer: WlrLayer.Background - color: "black" + WlrLayershell.layer: Config.background.wallpaperEnabled ? WlrLayer.Background : WlrLayer.Bottom + color: Config.background.wallpaperEnabled ? "black" : "transparent" + surfaceFormat.opaque: false anchors.top: true anchors.bottom: true @@ -35,8 +36,13 @@ Loader { anchors.fill: parent - Wallpaper { + Loader { id: wallpaper + + anchors.fill: parent + active: Config.background.wallpaperEnabled + + sourceComponent: Wallpaper {} } Visualiser { diff --git a/modules/background/Visualiser.qml b/modules/background/Visualiser.qml index c9bb9efb..35a086b9 100644 --- a/modules/background/Visualiser.qml +++ b/modules/background/Visualiser.qml @@ -13,7 +13,7 @@ Item { id: root required property ShellScreen screen - required property Wallpaper wallpaper + required property Item wallpaper readonly property bool shouldBeActive: Config.background.visualiser.enabled && (!Config.background.visualiser.autoHide || (Hypr.monitorFor(screen)?.activeWorkspace?.toplevels?.values.every(t => t.lastIpcObject?.floating) ?? true)) property real offset: shouldBeActive ? 0 : screen.height * 0.2 diff --git a/modules/background/Wallpaper.qml b/modules/background/Wallpaper.qml index b5d7d4af..39a48fc8 100644 --- a/modules/background/Wallpaper.qml +++ b/modules/background/Wallpaper.qml @@ -14,8 +14,6 @@ Item { property string source: Wallpapers.current property Image current: one - anchors.fill: parent - onSourceChanged: { if (!source) current = null; diff --git a/modules/controlcenter/appearance/AppearancePane.qml b/modules/controlcenter/appearance/AppearancePane.qml index 42511677..f29f7ab3 100644 --- a/modules/controlcenter/appearance/AppearancePane.qml +++ b/modules/controlcenter/appearance/AppearancePane.qml @@ -48,6 +48,7 @@ Item { property bool desktopClockBackgroundBlur: Config.background.desktopClock.background.blur ?? false property bool desktopClockInvertColors: Config.background.desktopClock.invertColors ?? false property bool backgroundEnabled: Config.background.enabled ?? true + property bool wallpaperEnabled: Config.background.wallpaperEnabled ?? true property bool visualiserEnabled: Config.background.visualiser.enabled ?? false property bool visualiserAutoHide: Config.background.visualiser.autoHide ?? true property real visualiserRounding: Config.background.visualiser.rounding ?? 1 @@ -83,6 +84,8 @@ Item { Config.background.desktopClock.background.blur = root.desktopClockBackgroundBlur; Config.background.desktopClock.invertColors = root.desktopClockInvertColors; + Config.background.wallpaperEnabled = root.wallpaperEnabled; + Config.background.visualiser.enabled = root.visualiserEnabled; Config.background.visualiser.autoHide = root.visualiserAutoHide; Config.background.visualiser.rounding = root.visualiserRounding; diff --git a/modules/controlcenter/appearance/sections/BackgroundSection.qml b/modules/controlcenter/appearance/sections/BackgroundSection.qml index 2f75c9e0..9d6bc6eb 100644 --- a/modules/controlcenter/appearance/sections/BackgroundSection.qml +++ b/modules/controlcenter/appearance/sections/BackgroundSection.qml @@ -27,6 +27,15 @@ CollapsibleSection { } } + SwitchRow { + label: qsTr("Wallpaper enabled") + checked: rootPane.wallpaperEnabled + onToggled: checked => { + rootPane.wallpaperEnabled = checked; + rootPane.saveConfig(); + } + } + StyledText { Layout.topMargin: Appearance.spacing.normal text: qsTr("Desktop Clock")