From 4cd554d19154a6c931d68e955751f9a66b60d9f2 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 20 Jul 2025 16:43:47 +1000 Subject: config: allow disabling background Closes #208 --- README.md | 3 +++ config/BackgroundConfig.qml | 5 +++++ config/Config.qml | 2 ++ modules/background/Background.qml | 35 ++++++++++++++++++++--------------- 4 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 config/BackgroundConfig.qml diff --git a/README.md b/README.md index 7d266eb..f2a0ff5 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,9 @@ All configuration options are in `~/.config/caelestia/shell.json`. ```json { + "background": { + "enabled": true + }, "bar": { "dragThreshold": 20, "persistent": true, diff --git a/config/BackgroundConfig.qml b/config/BackgroundConfig.qml new file mode 100644 index 0000000..9bcca87 --- /dev/null +++ b/config/BackgroundConfig.qml @@ -0,0 +1,5 @@ +import Quickshell.Io + +JsonObject { + property bool enabled: true +} diff --git a/config/Config.qml b/config/Config.qml index e713023..1ab8cb4 100644 --- a/config/Config.qml +++ b/config/Config.qml @@ -7,6 +7,7 @@ import Quickshell.Io Singleton { id: root + property alias background: adapter.background property alias bar: adapter.bar property alias border: adapter.border property alias dashboard: adapter.dashboard @@ -28,6 +29,7 @@ Singleton { JsonAdapter { id: adapter + property BackgroundConfig background: BackgroundConfig {} property BarConfig bar: BarConfig {} property BorderConfig border: BorderConfig {} property DashboardConfig dashboard: DashboardConfig {} diff --git a/modules/background/Background.qml b/modules/background/Background.qml index 72748d8..c744baa 100644 --- a/modules/background/Background.qml +++ b/modules/background/Background.qml @@ -1,26 +1,31 @@ import qs.widgets +import qs.config import Quickshell import Quickshell.Wayland -Variants { - model: Quickshell.screens +LazyLoader { + activeAsync: Config.background.enabled - StyledWindow { - id: win + Variants { + model: Quickshell.screens - required property ShellScreen modelData + StyledWindow { + id: win - screen: modelData - name: "background" - WlrLayershell.exclusionMode: ExclusionMode.Ignore - WlrLayershell.layer: WlrLayer.Background - color: "black" + required property ShellScreen modelData - anchors.top: true - anchors.bottom: true - anchors.left: true - anchors.right: true + screen: modelData + name: "background" + WlrLayershell.exclusionMode: ExclusionMode.Ignore + WlrLayershell.layer: WlrLayer.Background + color: "black" - Wallpaper {} + anchors.top: true + anchors.bottom: true + anchors.left: true + anchors.right: true + + Wallpaper {} + } } } -- cgit v1.2.3-freya