mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 08:30:41 +00:00
i3/sway: allow empty criterias using a value of 'true' (#2277)
Co-authored-by: Sumner Evans <me@sumnerevans.com>
This commit is contained in:
parent
4367119ca3
commit
c5b3069145
2 changed files with 20 additions and 7 deletions
|
@ -4,9 +4,13 @@ with lib;
|
|||
|
||||
rec {
|
||||
criteriaStr = criteria:
|
||||
"[${
|
||||
concatStringsSep " " (mapAttrsToList (k: v: ''${k}="${v}"'') criteria)
|
||||
}]";
|
||||
let
|
||||
toCriteria = k: v:
|
||||
if builtins.isBool v then
|
||||
(if v then "${k}" else "")
|
||||
else
|
||||
''${k}="${v}"'';
|
||||
in "[${concatStringsSep " " (mapAttrsToList toCriteria criteria)}]";
|
||||
|
||||
keybindingDefaultWorkspace = filterAttrs (n: v:
|
||||
cfg.config.defaultWorkspace != null && v == cfg.config.defaultWorkspace)
|
||||
|
|
|
@ -353,14 +353,23 @@ let
|
|||
|
||||
criteria = mkOption {
|
||||
type = criteriaModule;
|
||||
description =
|
||||
"Criteria of the windows on which command should be executed.";
|
||||
example = { title = "x200: ~/work"; };
|
||||
description = ''
|
||||
Criteria of the windows on which command should be executed.
|
||||
</para><para>
|
||||
A value of <literal>true</literal> is equivalent to using an empty
|
||||
criteria (which is different from an empty string criteria).
|
||||
'';
|
||||
example = literalExample ''
|
||||
{
|
||||
title = "x200: ~/work";
|
||||
floating = true;
|
||||
};
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
criteriaModule = types.attrsOf types.str;
|
||||
criteriaModule = types.attrsOf (types.either types.str types.bool);
|
||||
in {
|
||||
fonts = mkOption {
|
||||
type = with types; either (listOf str) fontOptions;
|
||||
|
|
Loading…
Reference in a new issue