config: allow disabling background

Closes #208
This commit is contained in:
2 * r + 2 * t 2025-07-20 16:43:47 +10:00
parent 7412052d12
commit 4cd554d191
4 changed files with 30 additions and 15 deletions

View file

@ -146,6 +146,9 @@ All configuration options are in `~/.config/caelestia/shell.json`.
```json ```json
{ {
"background": {
"enabled": true
},
"bar": { "bar": {
"dragThreshold": 20, "dragThreshold": 20,
"persistent": true, "persistent": true,

View file

@ -0,0 +1,5 @@
import Quickshell.Io
JsonObject {
property bool enabled: true
}

View file

@ -7,6 +7,7 @@ import Quickshell.Io
Singleton { Singleton {
id: root id: root
property alias background: adapter.background
property alias bar: adapter.bar property alias bar: adapter.bar
property alias border: adapter.border property alias border: adapter.border
property alias dashboard: adapter.dashboard property alias dashboard: adapter.dashboard
@ -28,6 +29,7 @@ Singleton {
JsonAdapter { JsonAdapter {
id: adapter id: adapter
property BackgroundConfig background: BackgroundConfig {}
property BarConfig bar: BarConfig {} property BarConfig bar: BarConfig {}
property BorderConfig border: BorderConfig {} property BorderConfig border: BorderConfig {}
property DashboardConfig dashboard: DashboardConfig {} property DashboardConfig dashboard: DashboardConfig {}

View file

@ -1,26 +1,31 @@
import qs.widgets import qs.widgets
import qs.config
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
Variants { LazyLoader {
model: Quickshell.screens activeAsync: Config.background.enabled
StyledWindow { Variants {
id: win model: Quickshell.screens
required property ShellScreen modelData StyledWindow {
id: win
screen: modelData required property ShellScreen modelData
name: "background"
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.layer: WlrLayer.Background
color: "black"
anchors.top: true screen: modelData
anchors.bottom: true name: "background"
anchors.left: true WlrLayershell.exclusionMode: ExclusionMode.Ignore
anchors.right: true WlrLayershell.layer: WlrLayer.Background
color: "black"
Wallpaper {} anchors.top: true
anchors.bottom: true
anchors.left: true
anchors.right: true
Wallpaper {}
}
} }
} }