terribly overengineered monitor -> workspace function

this probably adds around 20 years of eval time
This commit is contained in:
jacekpoz 2024-08-27 16:07:13 +02:00
parent e628f55645
commit 0bbc352e8f
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

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