qutebrowser: allow for specifying multiple commands in bindings ()

This command adds the ability to specify lists of qutebrowser
commands as values for key bindings, which avoids the need for
concatenating commands with ` ;; `.
This commit is contained in:
Kylie McClain 2023-03-15 14:22:12 -04:00 committed by GitHub
parent 2bd74d92bc
commit 95201931f2
Failed to generate hash of commit
2 changed files with 12 additions and 1 deletions
modules/programs
tests/modules/programs/qutebrowser

View file

@ -131,7 +131,7 @@ in {
}; };
keyBindings = mkOption { keyBindings = mkOption {
type = types.attrsOf (types.attrsOf types.str); type = with types; attrsOf (attrsOf (separatedString " ;; "));
default = { }; default = { };
description = '' description = ''
Key bindings mapping keys to commands in different modes. This setting Key bindings mapping keys to commands in different modes. This setting
@ -245,6 +245,11 @@ in {
"<Ctrl-v>" = "spawn mpv {url}"; "<Ctrl-v>" = "spawn mpv {url}";
",p" = "spawn --userscript qute-pass"; ",p" = "spawn --userscript qute-pass";
",l" = '''config-cycle spellcheck.languages ["en-GB"] ["en-US"]'''; ",l" = '''config-cycle spellcheck.languages ["en-GB"] ["en-US"]''';
"<F1>" = mkMerge [
"config-cycle tabs.show never always"
"config-cycle statusbar.show in-mode always"
"config-cycle scrolling.bar never always"
];
}; };
prompt = { prompt = {
"<Ctrl-y>" = "prompt-yes"; "<Ctrl-y>" = "prompt-yes";

View file

@ -13,6 +13,11 @@ with lib;
normal = { normal = {
"<Ctrl-v>" = "spawn mpv {url}"; "<Ctrl-v>" = "spawn mpv {url}";
",l" = ''config-cycle spellcheck.languages ["en-GB"] ["en-US"]''; ",l" = ''config-cycle spellcheck.languages ["en-GB"] ["en-US"]'';
"<F1>" = mkMerge [
"config-cycle tabs.show never always"
"config-cycle statusbar.show in-mode always"
"config-cycle scrolling.bar never always"
];
}; };
prompt = { "<Ctrl-y>" = "prompt-yes"; }; prompt = { "<Ctrl-y>" = "prompt-yes"; };
}; };
@ -34,6 +39,7 @@ with lib;
c.bindings.default = {} c.bindings.default = {}
config.bind(",l", "config-cycle spellcheck.languages [\"en-GB\"] [\"en-US\"]", mode="normal") config.bind(",l", "config-cycle spellcheck.languages [\"en-GB\"] [\"en-US\"]", mode="normal")
config.bind("<Ctrl-v>", "spawn mpv {url}", mode="normal") config.bind("<Ctrl-v>", "spawn mpv {url}", mode="normal")
config.bind("<F1>", "config-cycle tabs.show never always ;; config-cycle statusbar.show in-mode always ;; config-cycle scrolling.bar never always", mode="normal")
config.bind("<Ctrl-y>", "prompt-yes", mode="prompt")'' config.bind("<Ctrl-y>", "prompt-yes", mode="prompt")''
} }
''; '';