|
161 | 161 | };
|
162 | 162 |
|
163 | 163 | wallpaper = lib.mkOption {
|
164 |
| - type = with lib.types; nullOr path; |
| 164 | + type = with lib.types; nullOr (either path (listOf path)); |
165 | 165 | default = null;
|
166 | 166 | example = lib.literalExpression ''"''${pkgs.kdePackages.plasma-workspace-wallpapers}/share/wallpapers/Kay/contents/images/1080x1920.png"'';
|
167 | 167 | description = ''
|
|
453 | 453 | for (const desktop of allDesktops) {
|
454 | 454 | desktop.wallpaperPlugin = "org.kde.image";
|
455 | 455 | desktop.currentConfigGroup = ["Wallpaper", "org.kde.image", "General"];
|
456 |
| - desktop.writeConfig("Image", "file://${toString cfg.workspace.wallpaper}"); |
457 | 456 | ${
|
458 |
| - lib.optionalString (cfg.workspace.wallpaperFillMode != null) |
459 |
| - ''desktop.writeConfig("FillMode", "${ |
460 |
| - toString wallpaperFillModeTypes.${cfg.workspace.wallpaperFillMode} |
461 |
| - }");'' |
| 457 | + if (builtins.typeOf cfg.workspace.wallpaper) == "list" then |
| 458 | + '' |
| 459 | + let images = [ |
| 460 | + ${ |
| 461 | + builtins.concatStringsSep "\n," (map ( |
| 462 | + wallpaper: ''"file://${toString wallpaper}"'' |
| 463 | + ) cfg.workspace.wallpaper) |
| 464 | + } |
| 465 | + ]; |
| 466 | + let image = images[desktop.screen];'' |
| 467 | + else |
| 468 | + ''let image = "file://${toString cfg.workspace.wallpaper}""'' |
462 | 469 | }
|
463 |
| - ${ |
464 |
| - lib.optionalString (cfg.workspace.wallpaperBackground != null) |
465 |
| - ''desktop.writeConfig("${ |
466 |
| - if cfg.workspace.wallpaperBackground ? blur && cfg.workspace.wallpaperBackground.blur != null then |
467 |
| - "Blur" |
468 |
| - else if |
469 |
| - cfg.workspace.wallpaperBackground ? color && cfg.workspace.wallpaperBackground.color != null |
470 |
| - then |
471 |
| - "Color" |
472 |
| - else |
473 |
| - throw "plasma-manager: wallpaperBackground is not null and has no option set" |
474 |
| - }", "${ |
475 |
| - if cfg.workspace.wallpaperBackground ? blur && cfg.workspace.wallpaperBackground.blur != null then |
476 |
| - lib.boolToString cfg.workspace.wallpaperBackground.blur |
477 |
| - else if |
478 |
| - cfg.workspace.wallpaperBackground ? color && cfg.workspace.wallpaperBackground.color != null |
479 |
| - then |
480 |
| - cfg.workspace.wallpaperBackground.color |
481 |
| - else |
482 |
| - throw "plasma-manager: wallpaperBackground is not null and has no option set" |
483 |
| - }");'' |
| 470 | + if (image) { |
| 471 | + desktop.writeConfig("Image", image); |
| 472 | + ${ |
| 473 | + lib.optionalString (cfg.workspace.wallpaperBackground != null) |
| 474 | + ''desktop.writeConfig("${ |
| 475 | + if cfg.workspace.wallpaperBackground ? blur && cfg.workspace.wallpaperBackground.blur != null then |
| 476 | + "Blur" |
| 477 | + else if |
| 478 | + cfg.workspace.wallpaperBackground ? color && cfg.workspace.wallpaperBackground.color != null |
| 479 | + then |
| 480 | + "Color" |
| 481 | + else |
| 482 | + throw "plasma-manager: wallpaperBackground is not null and has no option set" |
| 483 | + }", "${ |
| 484 | + if cfg.workspace.wallpaperBackground ? blur && cfg.workspace.wallpaperBackground.blur != null then |
| 485 | + lib.boolToString cfg.workspace.wallpaperBackground.blur |
| 486 | + else if |
| 487 | + cfg.workspace.wallpaperBackground ? color && cfg.workspace.wallpaperBackground.color != null |
| 488 | + then |
| 489 | + cfg.workspace.wallpaperBackground.color |
| 490 | + else |
| 491 | + throw "plasma-manager: wallpaperBackground is not null and has no option set" |
| 492 | + }");'' |
| 493 | + } |
484 | 494 | }
|
485 | 495 | }
|
486 | 496 | '';
|
|
0 commit comments