about summary refs log tree commit diff
path: root/common.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2013-08-15 12:10:41 +0200
committeraszlig <aszlig@redmoonstudios.org>2013-08-15 13:52:43 +0200
commit20dc12f9462ff932c6df9f31d4f59e0fc598eb0a (patch)
tree43824dece87427ce19f030cd77a42d92dd3c3be8 /common.nix
parent72cbeed7489becef7aae8c5041e202653ee6c7a5 (diff)
i3: Do workspace assignment based on machine.
For example on dnyarri I only have the browser running on workspace 1 and the
XMPP client is running on another machine. These names are now generated from a
list of workspace names according to the respective machine name.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'common.nix')
-rw-r--r--common.nix17
1 files changed, 15 insertions, 2 deletions
diff --git a/common.nix b/common.nix
index 36ffa716..03d45c11 100644
--- a/common.nix
+++ b/common.nix
@@ -111,7 +111,7 @@
         default = "i3";
 
         i3.enable = true;
-        i3.configFile = with pkgs.lib; pkgs.substituteAll {
+        i3.configFile = with pkgs.lib; pkgs.substituteAll ({
           name = "i3.conf";
           src = ./cfgfiles/i3.conf;
 
@@ -135,7 +135,20 @@
             use_spacer left
             TEXT
           '';
-        };
+        } // (let
+          wsConfig = if config.networking.hostName == "mmrnmhrm"
+                     then [ "XMPP" null "chromium" null null
+                            null   null null       null null ]
+                     else [ "chromium" null null null null
+                            null       null null null null ];
+
+          mkWsName = num: name: let
+            mkPair = nameValuePair "ws${toString num}";
+          in if name == null
+             then mkPair (toString num)
+             else mkPair "${toString num}: ${name}";
+
+        in listToAttrs (imap mkWsName wsConfig)));
       };
 
       desktopManager.default = "none";