mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
qutebrowser: add option to load autoconfig (#1842)
See #1774. The option default to false.
This commit is contained in:
parent
0e2dc4be30
commit
73559e0dbc
3 changed files with 16 additions and 1 deletions
|
@ -51,6 +51,14 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
loadAutoconfig = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Load settings configured via the GUI.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
searchEngines = mkOption {
|
searchEngines = mkOption {
|
||||||
type = types.attrsOf types.str;
|
type = types.attrsOf types.str;
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -256,7 +264,12 @@ in {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.configFile."qutebrowser/config.py".text = concatStringsSep "\n" ([ ]
|
xdg.configFile."qutebrowser/config.py".text = concatStringsSep "\n" ([ ]
|
||||||
++ mapAttrsToList (formatLine "c.") cfg.settings
|
++ [
|
||||||
|
"${if cfg.loadAutoconfig then
|
||||||
|
"config.load_autoconfig()"
|
||||||
|
else
|
||||||
|
"config.load_autoconfig(False)"}"
|
||||||
|
] ++ mapAttrsToList (formatLine "c.") cfg.settings
|
||||||
++ mapAttrsToList (formatDictLine "c.aliases") cfg.aliases
|
++ mapAttrsToList (formatDictLine "c.aliases") cfg.aliases
|
||||||
++ mapAttrsToList (formatDictLine "c.url.searchengines") cfg.searchEngines
|
++ mapAttrsToList (formatDictLine "c.url.searchengines") cfg.searchEngines
|
||||||
++ mapAttrsToList (formatDictLine "c.bindings.key_mappings")
|
++ mapAttrsToList (formatDictLine "c.bindings.key_mappings")
|
||||||
|
|
|
@ -29,6 +29,7 @@ with lib;
|
||||||
home-files/.config/qutebrowser/config.py \
|
home-files/.config/qutebrowser/config.py \
|
||||||
${
|
${
|
||||||
pkgs.writeText "qutebrowser-expected-config.py" ''
|
pkgs.writeText "qutebrowser-expected-config.py" ''
|
||||||
|
config.load_autoconfig(False)
|
||||||
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")
|
||||||
|
|
|
@ -35,6 +35,7 @@ with lib;
|
||||||
home-files/.config/qutebrowser/config.py \
|
home-files/.config/qutebrowser/config.py \
|
||||||
${
|
${
|
||||||
pkgs.writeText "qutebrowser-expected-config.py" ''
|
pkgs.writeText "qutebrowser-expected-config.py" ''
|
||||||
|
config.load_autoconfig(False)
|
||||||
c.colors.hints.bg = "#000000"
|
c.colors.hints.bg = "#000000"
|
||||||
c.colors.hints.fg = "#ffffff"
|
c.colors.hints.fg = "#ffffff"
|
||||||
c.colors.tabs.bar.bg = "#000000"
|
c.colors.tabs.bar.bg = "#000000"
|
||||||
|
|
Loading…
Reference in a new issue