mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-15 17:50:53 +00:00
zathura: add mappings
option
This commit is contained in:
parent
44dcad5604
commit
ff5133843c
1 changed files with 22 additions and 1 deletions
|
@ -12,6 +12,8 @@ let
|
|||
if isBool v then (if v then "true" else "false") else toString v;
|
||||
in ''set ${n} "${formatValue v}"'';
|
||||
|
||||
formatMapLine = n: v: "map ${n} ${toString v}";
|
||||
|
||||
in {
|
||||
meta.maintainers = [ maintainers.rprospero ];
|
||||
|
||||
|
@ -45,6 +47,24 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
mappings = mkOption {
|
||||
default = { };
|
||||
type = with types; attrsOf str;
|
||||
description = ''
|
||||
Add <option>:map</option> mappings to zathura and make
|
||||
them permanent. See
|
||||
<citerefentry>
|
||||
<refentrytitle>zathurarc</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>
|
||||
for the full list of possible mappings.
|
||||
'';
|
||||
example = {
|
||||
D = "toggle_page_mode";
|
||||
"<Right>" = "navigate next";
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
|
@ -60,6 +80,7 @@ in {
|
|||
|
||||
xdg.configFile."zathura/zathurarc".text = concatStringsSep "\n" ([ ]
|
||||
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
||||
++ mapAttrsToList formatLine cfg.options) + "\n";
|
||||
++ mapAttrsToList formatLine cfg.options
|
||||
++ mapAttrsToList formatMapLine cfg.mappings) + "\n";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue