nix-conf/home/user/hypr/workspace.nix
2025-08-09 22:22:19 +08:00

20 lines
485 B
Nix

{ monitors }:
let
inherit (builtins)
length
genList
toString
elemAt
;
monitorNum = length monitors;
workspaceNum = 10;
workspaceList = genList (
index:
let
currentNum = index - (monitorNum * (index / monitorNum));
default = if index < monitorNum then "true" else "false";
in
"${toString (index + 1)}, monitor:${elemAt monitors currentNum}, default:${default}"
) workspaceNum;
in
if (monitorNum > 0) then workspaceList else [ ]