mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-24 18:19:11 +00:00
nixos/workflows/a-happy-gnome: add module option to configure static workspaces
This commit is contained in:
parent
2c066787ef
commit
a5aeb823f3
@ -192,6 +192,8 @@ in {
|
|||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableStaticWorkspace = lib.mkEnableOption "static workspaces configuration for PaperWM";
|
||||||
|
|
||||||
winprops = lib.mkOption {
|
winprops = lib.mkOption {
|
||||||
type = let
|
type = let
|
||||||
inherit (lib.types) listOf;
|
inherit (lib.types) listOf;
|
||||||
@ -321,13 +323,24 @@ in {
|
|||||||
let
|
let
|
||||||
mkWorkspaceConfig = name: value:
|
mkWorkspaceConfig = name: value:
|
||||||
lib.nameValuePair "org/gnome/shell/extensions/paperwm/workspaces/${name}" value;
|
lib.nameValuePair "org/gnome/shell/extensions/paperwm/workspaces/${name}" value;
|
||||||
|
|
||||||
|
workspaces = lib.attrNames cfg.paperwm.workspaces;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
"org/gnome/shell/extensions/paperwm/workspaces".list =
|
"org/gnome/shell/extensions/paperwm/workspaces".list = workspaces;
|
||||||
lib.attrNames cfg.paperwm.workspaces;
|
|
||||||
}
|
}
|
||||||
// lib.mapAttrs' mkWorkspaceConfig cfg.paperwm.workspaces
|
// lib.mapAttrs' mkWorkspaceConfig cfg.paperwm.workspaces
|
||||||
))
|
))
|
||||||
|
|
||||||
|
(lib.mkIf cfg.paperwm.enableStaticWorkspace {
|
||||||
|
"org/gnome/mutter/dynamic-workspaces" = false;
|
||||||
|
|
||||||
|
"org/gnome/desktop/wm/preferences/num-workspaces" =
|
||||||
|
let
|
||||||
|
workspaces = lib.attrNames cfg.paperwm.workspaces;
|
||||||
|
in
|
||||||
|
lib.gvariant.mkInt32 (lib.length workspaces);
|
||||||
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user