diff --git a/modules/gui/hypr/land.nix b/modules/gui/hypr/land.nix index d1cb570..5cf8d37 100644 --- a/modules/gui/hypr/land.nix +++ b/modules/gui/hypr/land.nix @@ -188,17 +188,17 @@ in { "${name},${w}x${h}@${refresh},${x}x${y},${scale}" ) config.poz.other.hardware.monitors; - workspace = ( - # laptop - map (i: - "${i}, monitor:eDP-1${optionalString (i == "1") ", default:true"}" - ) (genList (i: toString (i + 1)) 10) - ) ++ ( - # second monitor - map (i: - "${i}, monitor:HDMI-A-1${optionalString (i == "11") ", default:true"}" - ) (genList (i: toString (i + 11)) 10) - ) ++ [ + # I'm so sorry + workspace = (flatten (imap0 (monitor_index: monitor_name: ( + map (i: let + # a % b + mod = a: b: a - (b * (a / b)); + workspace = toString i; + isDefault = (mod i 10) == 1; # 11, 21, 31, ... + in + "${workspace}, monitor:${monitor_name}${optionalString isDefault ", default:true"}" + ) (genList (i: i + 1 + (10 * monitor_index)) 10) + )) (attrNames config.poz.other.hardware.monitors))) ++ [ # scratchpads "special:btop, decorate:false" (mkIf isAmdGpuPresent "special:amdgpu_top, decorate:false")