about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-07-25 16:08:33 +0200
committeraszlig <aszlig@redmoonstudios.org>2014-07-25 16:08:33 +0200
commit6552bb1fa4796dbdb0a5537d21ffb9297857bd90 (patch)
tree881f4e4d48b6a8c11fe84d17d1a47301a3785517 /modules
parent9fd19cf84d03a8e0757a8b6271ea903da6b47d22 (diff)
i3: Allow to work only with a single head.
This is very ugly and just to be taken as a workaround because the i3
status line will be completely messed up. The main reason for doing this
is that the config will evaluate with a single head.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'modules')
-rw-r--r--modules/i3/default.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/i3/default.nix b/modules/i3/default.nix
index 4ac730ed..25121fa3 100644
--- a/modules/i3/default.nix
+++ b/modules/i3/default.nix
@@ -24,7 +24,8 @@ let
       labelPrefix = "${toString number}: ";
       keys.switchTo = "$mod+${if number == 10 then "0" else toString number}";
       keys.moveTo = "$mod+Shift+${numberSymbol}";
-      head = getHeadAt ((number - (excessWs + 1)) / wsPerHead);
+      head = if headCount == 0 then null
+             else getHeadAt ((number - (excessWs + 1)) / wsPerHead);
     };
   };
 
@@ -77,11 +78,13 @@ in
       inherit (pkgs.xorg) xsetroot;
       inherit wsConfig;
 
-      leftHead = head config.services.xserver.xrandrHeads;
-      rightHead = last config.services.xserver.xrandrHeads;
 
       leftConky = conky.left;
       rightConky = conky.right;
+    } // optionalAttrs (config.networking.hostName == "mmrnmhrm" || # <- XXX
+                        config.networking.hostName == "dnyarri") ({
+      leftHead = head config.services.xserver.xrandrHeads;
+      rightHead = last config.services.xserver.xrandrHeads;
     } // (let
       # Workaround for Synergy: we need to have polarizing heads.
       leftHead = head config.services.xserver.xrandrHeads;
@@ -89,6 +92,6 @@ in
     in if config.networking.hostName == "mmrnmhrm"
        then { inherit leftHead rightHead; }
        else { leftHead = rightHead; rightHead = leftHead; }
-    ));
+    )));
   };
 }