From 45a348bda6549147c3293bc6291341400906cd0a Mon Sep 17 00:00:00 2001 From: Siddharth More Date: Sun, 3 Nov 2024 19:57:18 +0530 Subject: [PATCH 1/2] Added virtual desktop id attributes --- modules/kwin.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/kwin.nix b/modules/kwin.nix index 6d2c3d63..a8eb1626 100644 --- a/modules/kwin.nix +++ b/modules/kwin.nix @@ -56,6 +56,10 @@ let names: builtins.listToAttrs (lib.imap1 (i: v: (lib.nameValuePair "Name_${builtins.toString i}" v)) names); + virtualDesktopIdAttrs = + names: + builtins.listToAttrs (lib.imap1 (i: v: (lib.nameValuePair "Id_${builtins.toString i}" v)) names); + capitalizeWord = word: let @@ -712,6 +716,7 @@ in (lib.mkIf (cfg.kwin.virtualDesktops.names != null) { Desktops = lib.mkMerge [ { Number = builtins.length cfg.kwin.virtualDesktops.names; } + (virtualDesktopIdAttrs cfg.kwin.virtualDesktops.names) (virtualDesktopNameAttrs cfg.kwin.virtualDesktops.names) ]; }) From cb460094c6d16823c207de73132f5a8670c88d06 Mon Sep 17 00:00:00 2001 From: Siddharth More Date: Sun, 3 Nov 2024 22:32:48 +0530 Subject: [PATCH 2/2] Update virtual desktop id attributes --- modules/kwin.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/kwin.nix b/modules/kwin.nix index a8eb1626..f5597a4d 100644 --- a/modules/kwin.nix +++ b/modules/kwin.nix @@ -56,9 +56,10 @@ let names: builtins.listToAttrs (lib.imap1 (i: v: (lib.nameValuePair "Name_${builtins.toString i}" v)) names); + virtualDesktopIdAttrs = - names: - builtins.listToAttrs (lib.imap1 (i: v: (lib.nameValuePair "Id_${builtins.toString i}" v)) names); + number: + builtins.listToAttrs (map (i: (lib.nameValuePair "Id_${builtins.toString i}" "Desktop_${builtins.toString i}")) (lib.range 1 number)); capitalizeWord = word: @@ -708,7 +709,10 @@ in # Virtual Desktops (lib.mkIf (cfg.kwin.virtualDesktops.number != null) { - Desktops.Number = cfg.kwin.virtualDesktops.number; + Desktops = lib.mkMerge [ + { Number = cfg.kwin.virtualDesktops.number; } + (virtualDesktopIdAttrs cfg.kwin.virtualDesktops.number) + ]; }) (lib.mkIf (cfg.kwin.virtualDesktops.rows != null) { Desktops.Rows = cfg.kwin.virtualDesktops.rows; @@ -716,7 +720,7 @@ in (lib.mkIf (cfg.kwin.virtualDesktops.names != null) { Desktops = lib.mkMerge [ { Number = builtins.length cfg.kwin.virtualDesktops.names; } - (virtualDesktopIdAttrs cfg.kwin.virtualDesktops.names) + (virtualDesktopIdAttrs (builtins.length cfg.kwin.virtualDesktops.names)) (virtualDesktopNameAttrs cfg.kwin.virtualDesktops.names) ]; })