i3: add test of keybinding merge logic

This commit is contained in:
Robert Helgesson 2019-01-14 22:50:11 +01:00
parent bb64012914
commit c42206db02
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 36 additions and 0 deletions

View file

@ -20,5 +20,7 @@ import nmt {
"git/with-str-extra-config" = ./modules/programs/git-with-str-extra-config.nix;
texlive-minimal = ./modules/programs/texlive-minimal.nix;
xresources = ./modules/xresources.nix;
} // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
"i3/keybindings" = ./modules/services/window-managers/i3-keybindings.nix;
};
}

View file

@ -0,0 +1,34 @@
{ config, lib, ... }:
with lib;
{
config = {
xsession.windowManager.i3 = {
enable = true;
config.keybindings =
let
modifier = config.xsession.windowManager.i3.config.modifier;
in
lib.mkOptionDefault {
"${modifier}+Left" = "overridden-command";
"${modifier}+Right" = null;
"${modifier}+Invented" = "invented-key-command";
};
};
nmt.script = ''
assertFileExists home-files/.config/i3/config
assertFileRegex home-files/.config/i3/config \
'bindsym Mod1+Left overridden-command'
assertFileNotRegex home-files/.config/i3/config \
'Mod1+Right'
assertFileRegex home-files/.config/i3/config \
'bindsym Mod1+Invented invented-key-command'
'';
};
}