2020-10-12 00:22:58 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
config = {
|
|
|
|
programs.qutebrowser = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
enableDefaultBindings = false;
|
|
|
|
|
|
|
|
keyBindings = {
|
|
|
|
normal = {
|
|
|
|
"<Ctrl-v>" = "spawn mpv {url}";
|
|
|
|
",l" = ''config-cycle spellcheck.languages ["en-GB"] ["en-US"]'';
|
|
|
|
};
|
|
|
|
prompt = { "<Ctrl-y>" = "prompt-yes"; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-11-04 16:42:44 +00:00
|
|
|
test.stubs.qutebrowser = { };
|
2020-10-12 00:22:58 +00:00
|
|
|
|
2021-07-02 22:36:30 +00:00
|
|
|
nmt.script = let
|
|
|
|
qutebrowserConfig = if pkgs.stdenv.hostPlatform.isDarwin then
|
|
|
|
".qutebrowser/config.py"
|
|
|
|
else
|
|
|
|
".config/qutebrowser/config.py";
|
|
|
|
in ''
|
2020-10-12 00:22:58 +00:00
|
|
|
assertFileContent \
|
2021-07-02 22:36:30 +00:00
|
|
|
home-files/${qutebrowserConfig} \
|
2020-10-12 00:22:58 +00:00
|
|
|
${
|
|
|
|
pkgs.writeText "qutebrowser-expected-config.py" ''
|
2021-07-02 22:36:30 +00:00
|
|
|
config.load_autoconfig(False)
|
2020-10-12 00:22:58 +00:00
|
|
|
c.bindings.default = {}
|
|
|
|
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-y>", "prompt-yes", mode="prompt")''
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|