feat(kwin): wallpapers for monitors and workspaces

Plasma keeps one wallpaper for each screen, not for each virtual desktop, so a
workspace that wants a picture of its own has nowhere to keep it in the shell.
komorebi sets the wallpaper of a screen when a workspace comes into view: the
workspace's own, else its monitor's. It does so however the workspace came into
view (a komorebic command, a pager, an application raising a window) and for the
workspace in front when it starts. A monitor and a workspace with no wallpaper
are left alone.

The Plasma shell sets it over D-Bus, with the call plasma-apply-wallpaperimage
makes, but for one screen. Backend::set_wallpaper asks for it every time a
workspace comes into view, and the KWin backend asks the shell what the screen
shows first, so a picture the user changed by hand is put back and one that is
already right is not touched. The request runs in the background, so switching
workspaces never waits for the shell, and goes on trying for about half a minute
when the shell is not up yet.

A wallpaper also gives the borders the colors of the palette made from its
picture, unless it says generate_theme is false, and theme_options choose the
variant and the color each border takes. The colors change before the workspace
is shown, so its borders are right at once.

komorebi.json takes the wallpaper of a monitor and the wallpaper of a workspace,
and a file that is read again shows the wallpaper of the workspace each monitor
has in front at once. vm-wallpaper runs against the real shell: set at start and
by workspace, a switch komorebi did not make, the colors of the borders, a
wallpaper changed by hand, the palette cache, and komorebi that starts before
the shell.
This commit is contained in:
LGUG2Z committed 2026-10-28 07:20:49 -07:00
1 parent e6ddb5a7c9
commit 2b116ea2a3
25 files changed
+1881 -135

No files matched your search

+171
View File
@@ -3159,6 +3159,17 @@
],
"default": "Tile"
},
"wallpaper": {
"description": "Specify a wallpaper for this monitor",
"anyOf": [
{
"$ref": "#/$defs/Wallpaper"
},
{
"type": "null"
}
]
},
"window_based_work_area_offset": {
"description": "Window based work area offset",
"anyOf": [
@@ -3459,6 +3470,155 @@
"columns"
]
},
"ThemeOptions": {
"description": "Theme options",
"type": "object",
"properties": {
"bar_accent": {
"description": "Komorebi status bar accent",
"anyOf": [
{
"$ref": "#/$defs/Base16Value"
},
{
"type": "null"
}
],
"default": "Base0D"
},
"floating_border": {
"description": "Border color when the window is floating",
"anyOf": [
{
"$ref": "#/$defs/Base16Value"
},
{
"type": "null"
}
],
"default": "Base09"
},
"monocle_border": {
"description": "Border color when the container is in monocle mode",
"anyOf": [
{
"$ref": "#/$defs/Base16Value"
},
{
"type": "null"
}
],
"default": "Base0F"
},
"single_border": {
"description": "Border color when the container contains a single window",
"anyOf": [
{
"$ref": "#/$defs/Base16Value"
},
{
"type": "null"
}
],
"default": "Base0D"
},
"stack_border": {
"description": "Border color when the container contains multiple windows",
"anyOf": [
{
"$ref": "#/$defs/Base16Value"
},
{
"type": "null"
}
],
"default": "Base0B"
},
"theme_variant": {
"description": "Specify Light or Dark variant for theme generation",
"anyOf": [
{
"$ref": "#/$defs/ThemeVariant"
},
{
"type": "null"
}
],
"default": "Dark"
},
"unfocused_border": {
"description": "Border color when the container is unfocused",
"anyOf": [
{
"$ref": "#/$defs/Base16Value"
},
{
"type": "null"
}
],
"default": "Base01"
},
"unfocused_locked_border": {
"description": "Border color when the container is unfocused and locked",
"anyOf": [
{
"$ref": "#/$defs/Base16Value"
},
{
"type": "null"
}
],
"default": "Base08"
}
}
},
"ThemeVariant": {
"description": "Theme variant",
"oneOf": [
{
"description": "Dark variant",
"type": "string",
"const": "Dark"
},
{
"description": "Light variant",
"type": "string",
"const": "Light"
}
]
},
"Wallpaper": {
"description": "Wallpaper configuration",
"type": "object",
"properties": {
"generate_theme": {
"description": "Generate and apply Base16 theme for this wallpaper",
"type": [
"boolean",
"null"
],
"default": true
},
"path": {
"description": "Path to the wallpaper image file",
"$ref": "#/$defs/PathBuf"
},
"theme_options": {
"description": "Specify theme options",
"anyOf": [
{
"$ref": "#/$defs/ThemeOptions"
},
{
"type": "null"
}
]
}
},
"required": [
"path"
]
},
"WindowContainerBehaviour": {
"description": "Window container behavior when a new window is opened",
"oneOf": [
@@ -3611,6 +3771,17 @@
],
"default": true
},
"wallpaper": {
"description": "Specify a wallpaper for this workspace",
"anyOf": [
{
"$ref": "#/$defs/Wallpaper"
},
{
"type": "null"
}
]
},
"window_container_behaviour": {
"description": "Determine what happens when a new window is opened",
"anyOf": [