2020-05-01 22:48:03 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
config = {
|
|
|
|
programs.qutebrowser = {
|
|
|
|
enable = true;
|
|
|
|
|
2020-07-27 08:54:11 +00:00
|
|
|
enableDefaultBindings = false;
|
|
|
|
|
2020-05-01 22:48:03 +00:00
|
|
|
keyBindings = {
|
|
|
|
normal = {
|
|
|
|
"<Ctrl-v>" = "spawn mpv {url}";
|
|
|
|
",l" = ''config-cycle spellcheck.languages ["en-GB"] ["en-US"]'';
|
2023-03-15 18:22:12 +00:00
|
|
|
"<F1>" = mkMerge [
|
|
|
|
"config-cycle tabs.show never always"
|
|
|
|
"config-cycle statusbar.show in-mode always"
|
|
|
|
"config-cycle scrolling.bar never always"
|
|
|
|
];
|
2020-05-01 22:48:03 +00:00
|
|
|
};
|
|
|
|
prompt = { "<Ctrl-y>" = "prompt-yes"; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-09-26 09:08:45 +00:00
|
|
|
test.stubs.qutebrowser = { };
|
2020-05-01 22:48:03 +00:00
|
|
|
|
2021-04-28 18:41:30 +00:00
|
|
|
nmt.script = let
|
|
|
|
qutebrowserConfig = if pkgs.stdenv.hostPlatform.isDarwin then
|
|
|
|
".qutebrowser/config.py"
|
|
|
|
else
|
|
|
|
".config/qutebrowser/config.py";
|
|
|
|
in ''
|
2020-05-01 22:48:03 +00:00
|
|
|
assertFileContent \
|
2021-04-28 18:41:30 +00:00
|
|
|
home-files/${qutebrowserConfig} \
|
2020-05-01 22:48:03 +00:00
|
|
|
${
|
|
|
|
pkgs.writeText "qutebrowser-expected-config.py" ''
|
2021-03-05 03:33:23 +00:00
|
|
|
config.load_autoconfig(False)
|
2020-07-27 08:54:11 +00:00
|
|
|
c.bindings.default = {}
|
2020-05-01 22:48:03 +00:00
|
|
|
config.bind(",l", "config-cycle spellcheck.languages [\"en-GB\"] [\"en-US\"]", mode="normal")
|
|
|
|
config.bind("<Ctrl-v>", "spawn mpv {url}", mode="normal")
|
2023-03-15 18:22:12 +00:00
|
|
|
config.bind("<F1>", "config-cycle tabs.show never always ;; config-cycle statusbar.show in-mode always ;; config-cycle scrolling.bar never always", mode="normal")
|
2020-05-01 22:48:03 +00:00
|
|
|
config.bind("<Ctrl-y>", "prompt-yes", mode="prompt")''
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|