about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--machines/dnyarri.nix1
-rw-r--r--modules/i3/default.nix13
2 files changed, 13 insertions, 1 deletions
diff --git a/machines/dnyarri.nix b/machines/dnyarri.nix
index 378e29db..bc3ac135 100644
--- a/machines/dnyarri.nix
+++ b/machines/dnyarri.nix
@@ -133,6 +133,7 @@ with import ../lib;
   services.xserver.videoDrivers = [ "ati" ];
   services.xserver.xrandrHeads = [ "HDMI-0" "DVI-0" ];
 
+  aszlig.i3.reverseHeads = true;
   aszlig.i3.workspaces."6" = {
     label = "Chromium";
     assign = singleton { class = "^Chromium(?:-browser)?\$"; };
diff --git a/modules/i3/default.nix b/modules/i3/default.nix
index 7a47b1c9..4ac730ed 100644
--- a/modules/i3/default.nix
+++ b/modules/i3/default.nix
@@ -14,7 +14,8 @@ let
   headCount = length config.services.xserver.xrandrHeads;
   wsPerHead = wsCount / headCount;
   excessWs = wsCount - (headCount * wsPerHead);
-  getHeadAt = elemAt config.services.xserver.xrandrHeads;
+  headModifier = if config.aszlig.i3.reverseHeads then reverseList else id;
+  getHeadAt = elemAt (headModifier config.services.xserver.xrandrHeads);
 
   mkDefaultWorkspace = number: numberSymbol: {
     name = toString number;
@@ -46,6 +47,16 @@ in
         monitor and 6 to 10 on the right.
       '';
     };
+
+    reverseHeads = mkOption {
+      type = types.bool;
+      default = false;
+      description = ''
+        Reverse the order of the heads, so if enabled and you have two heads,
+        you'll end up having workspaces 1 to 5 on the right head and 6 to 10 on
+        the left head.
+      '';
+    };
   };
 
   config.aszlig.i3.workspaces = defaultWorkspaces;