From 204f1ceaf26e3bab24054f119472dfa2f524bee0 Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 1 Aug 2014 18:27:41 +0200 Subject: i3: Fix generating config for a single head. If there is only one head, we don't need any "workspace" command in the i3 configuration file, so let's omit it entirely. Signed-off-by: aszlig --- modules/i3/workspace.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/i3/workspace.nix b/modules/i3/workspace.nix index 5365bf74..403ba57d 100644 --- a/modules/i3/workspace.nix +++ b/modules/i3/workspace.nix @@ -92,11 +92,12 @@ in }; config.config = let - maybeOutput = optionalString (config.head != null) " output ${config.head}"; mkAssign = mapAttrsToList (criteria: value: "${criteria}=\"${value}\""); mkSym = sym: rest: optionalString (sym != null) "bindsym ${sym} ${rest}"; in '' - workspace "${finalLabel}"${maybeOutput} + ${optionalString (config.head != null) '' + workspace "${finalLabel}" output ${config.head} + ''} ${mkSym config.keys.switchTo "workspace \"${finalLabel}\""} ${mkSym config.keys.moveTo "move workspace \"${finalLabel}\""} ${concatMapStrings (assign: '' -- cgit 1.4.1