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
|
@ -4,9 +4,13 @@ with lib;
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
criteriaStr = criteria:
|
criteriaStr = criteria:
|
||||||
"[${
|
let
|
||||||
concatStringsSep " " (mapAttrsToList (k: v: ''${k}="${v}"'') criteria)
|
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:
|
keybindingDefaultWorkspace = filterAttrs (n: v:
|
||||||
cfg.config.defaultWorkspace != null && v == cfg.config.defaultWorkspace)
|
cfg.config.defaultWorkspace != null && v == cfg.config.defaultWorkspace)
|
||||||
|
|
|
@ -353,14 +353,23 @@ let
|
||||||
|
|
||||||
criteria = mkOption {
|
criteria = mkOption {
|
||||||
type = criteriaModule;
|
type = criteriaModule;
|
||||||
description =
|
description = ''
|
||||||
"Criteria of the windows on which command should be executed.";
|
Criteria of the windows on which command should be executed.
|
||||||
example = { title = "x200: ~/work"; };
|
</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 {
|
in {
|
||||||
fonts = mkOption {
|
fonts = mkOption {
|
||||||
type = with types; either (listOf str) fontOptions;
|
type = with types; either (listOf str) fontOptions;
|
||||||
|
|
Loading…
Reference in a new issue