diff options
-rw-r--r-- | modules/user/aszlig/profiles/workstation/default.nix | 11 | ||||
-rw-r--r-- | modules/user/aszlig/services/i3/default.nix | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/modules/user/aszlig/profiles/workstation/default.nix b/modules/user/aszlig/profiles/workstation/default.nix index 34b08731..05b830fd 100644 --- a/modules/user/aszlig/profiles/workstation/default.nix +++ b/modules/user/aszlig/profiles/workstation/default.nix @@ -2,7 +2,7 @@ let cfg = config.vuizvui.user.aszlig.profiles.workstation; - randrHeads = config.services.xserver.xrandrHeads; + inherit (config.services.xserver) xrandrHeads; in { options.vuizvui.user.aszlig.profiles.workstation = { @@ -16,12 +16,13 @@ in { boot.cleanTmpDir = true; environment.systemPackages = with lib; let - mkRandrConf = acc: name: acc ++ singleton { - inherit name; - value = "--output '${name}' --preferred" + mkRandrConf = acc: rcfg: acc ++ singleton { + name = rcfg.output; + value = "--output ${lib.escapeShellArg rcfg.output} --preferred" + + optionalString rcfg.primary " --primary" + optionalString (acc != []) " --right-of '${(head acc).name}'"; }; - randrConf = map (getAttr "value") (foldl mkRandrConf [] randrHeads); + randrConf = map (getAttr "value") (foldl mkRandrConf [] xrandrHeads); in singleton (pkgs.writeScriptBin "xreset" '' #!${pkgs.stdenv.shell} ${pkgs.xorg.xrandr}/bin/xrandr ${concatStringsSep " " randrConf} diff --git a/modules/user/aszlig/services/i3/default.nix b/modules/user/aszlig/services/i3/default.nix index 9000efb3..34767e38 100644 --- a/modules/user/aszlig/services/i3/default.nix +++ b/modules/user/aszlig/services/i3/default.nix @@ -18,7 +18,7 @@ let wsPerHead = wsCount / headCount; excessWs = wsCount - (headCount * wsPerHead); headModifier = if cfg.reverseHeads then reverseList else id; - getHeadAt = elemAt (headModifier xrandrHeads); + getHeadAt = x: (elemAt (headModifier xrandrHeads) x).output; mkSwitchTo = number: "$mod+${if number == 10 then "0" else toString number}"; @@ -57,7 +57,7 @@ let ''; barConfig = let - barHeads = headModifier xrandrHeads; + barHeads = map (h: h.output) (headModifier xrandrHeads); bars = if headCount == 0 then mkBar null conky.single else if headCount == 1 then mkBar (head barHeads) conky.single else let inner = take (length barHeads - 2) (tail barHeads); |