From a07762d1531f24d5657d1ae4ead025298b6baa58 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Thu, 5 Dec 2024 11:25:56 -0300 Subject: [PATCH] test --- modules/workspace.nix | 45 +++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/modules/workspace.nix b/modules/workspace.nix index e28e69b5..5f51e6ed 100644 --- a/modules/workspace.nix +++ b/modules/workspace.nix @@ -461,18 +461,25 @@ in }");'' } ${ - lib.optionalString - (cfg.workspace.wallpaperBackground != null || cfg.workspace.wallpaperBackground != { }) + lib.optionalString (cfg.workspace.wallpaperBackground != null) ''desktop.writeConfig("${ if cfg.workspace.wallpaperBackground ? blur && cfg.workspace.wallpaperBackground.blur != null then "Blur" - else + else if + cfg.workspace.wallpaperBackground ? color && cfg.workspace.wallpaperBackground.blur != null + then "Color" + else + throw "plasma-manager: wallpaperBackground is not null and has no option set" }", "${ if cfg.workspace.wallpaperBackground ? blur && cfg.workspace.wallpaperBackground.blur != null then lib.boolToString cfg.workspace.wallpaperBackground.blur - else + else if + cfg.workspace.wallpaperBackground ? color && cfg.workspace.wallpaperBackground.color != null + then cfg.workspace.wallpaperBackground.color + else + throw "plasma-manager: wallpaperBackground is not null and has no option set" }");'' } } @@ -500,18 +507,25 @@ in }");'' } ${ - lib.optionalString - (cfg.workspace.wallpaperBackground != null || cfg.workspace.wallpaperBackground != { }) + lib.optionalString (cfg.workspace.wallpaperBackground != null) ''desktop.writeConfig("${ if cfg.workspace.wallpaperBackground ? blur && cfg.workspace.wallpaperBackground.blur != null then "Blur" - else + else if + cfg.workspace.wallpaperBackground ? color && cfg.workspace.wallpaperBackground.blur != null + then "Color" + else + throw "plasma-manager: wallpaperBackground is not null and has no option set" }", "${ if cfg.workspace.wallpaperBackground ? blur && cfg.workspace.wallpaperBackground.blur != null then lib.boolToString cfg.workspace.wallpaperBackground.blur - else + else if + cfg.workspace.wallpaperBackground ? color && cfg.workspace.wallpaperBackground.color != null + then cfg.workspace.wallpaperBackground.color + else + throw "plasma-manager: wallpaperBackground is not null and has no option set" }");'' } } @@ -560,18 +574,25 @@ in }");'' } ${ - lib.optionalString - (cfg.workspace.wallpaperBackground != null || cfg.workspace.wallpaperBackground != { }) + lib.optionalString (cfg.workspace.wallpaperBackground != null) ''desktop.writeConfig("${ if cfg.workspace.wallpaperBackground ? blur && cfg.workspace.wallpaperBackground.blur != null then "Blur" - else + else if + cfg.workspace.wallpaperBackground ? color && cfg.workspace.wallpaperBackground.blur != null + then "Color" + else + throw "plasma-manager: wallpaperBackground is not null and has no option set" }", "${ if cfg.workspace.wallpaperBackground ? blur && cfg.workspace.wallpaperBackground.blur != null then lib.boolToString cfg.workspace.wallpaperBackground.blur - else + else if + cfg.workspace.wallpaperBackground ? color && cfg.workspace.wallpaperBackground.color != null + then cfg.workspace.wallpaperBackground.color + else + throw "plasma-manager: wallpaperBackground is not null and has no option set" }");'' } }