mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-14 13:01:09 +01:00
feh: add themes option (#6074)
- added themes option - added themes test - updated broken man page links
This commit is contained in:
parent
35b055009a
commit
1d0862ee2d
5 changed files with 78 additions and 2 deletions
|
|
@ -8,6 +8,12 @@ let
|
|||
|
||||
bindingsOf = t: with types; attrsOf (nullOr (either t (listOf t)));
|
||||
|
||||
renderThemes = options:
|
||||
let
|
||||
render =
|
||||
mapAttrsToList (theme: options: "${theme} ${escapeShellArgs options}");
|
||||
in concatStringsSep "\n" (render options);
|
||||
|
||||
renderBindings = bindings:
|
||||
let
|
||||
enabled = filterAttrs (n: v: v != null) bindings;
|
||||
|
|
@ -41,7 +47,7 @@ in {
|
|||
Override feh's default mouse button mapping. If you want to disable an
|
||||
action, set its value to null. If you want to bind multiple buttons to
|
||||
an action, set its value to a list.
|
||||
See <https://man.finalrewind.org/1/feh/#x425554544f4e53> for
|
||||
See <https://man.finalrewind.org/1/feh/#BUTTONS_CONFIG_SYNTAX> for
|
||||
default bindings and available commands.
|
||||
'';
|
||||
};
|
||||
|
|
@ -58,10 +64,37 @@ in {
|
|||
Override feh's default keybindings. If you want to disable a keybinding
|
||||
set its value to null. If you want to bind multiple keys to an action,
|
||||
set its value to a list.
|
||||
See <https://man.finalrewind.org/1/feh/#x4b455953> for
|
||||
See <https://man.finalrewind.org/1/feh/#KEYS_CONFIG_SYNTAX> for
|
||||
default bindings and available commands.
|
||||
'';
|
||||
};
|
||||
|
||||
themes = mkOption {
|
||||
default = { };
|
||||
type = with types; attrsOf (listOf str);
|
||||
example = {
|
||||
feh = [ "--image-bg" "black" ];
|
||||
webcam = [ "--multiwindow" "--reload" "20" ];
|
||||
present = [ "--full-screen" "--sort" "name" "--hide-pointer" ];
|
||||
booth = [ "--full-screen" "--hide-pointer" "--slideshow-delay" "20" ];
|
||||
imagemap = [
|
||||
"-rVq"
|
||||
"--thumb-width"
|
||||
"40"
|
||||
"--thumb-height"
|
||||
"30"
|
||||
"--index-info"
|
||||
"%n\\n%wx%h"
|
||||
];
|
||||
example = [ "--info" "foo bar" ];
|
||||
};
|
||||
description = ''
|
||||
Define themes for feh.
|
||||
See <https://man.finalrewind.org/1/feh/#THEMES_CONFIG_SYNTAX> for
|
||||
important guidelines and limitations related to theme configuration.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
|
@ -79,5 +112,8 @@ in {
|
|||
xdg.configFile."feh/keys" = mkIf (cfg.keybindings != { }) {
|
||||
text = renderBindings cfg.keybindings + "\n";
|
||||
};
|
||||
|
||||
xdg.configFile."feh/themes" =
|
||||
mkIf (cfg.themes != { }) { text = renderThemes cfg.themes + "\n"; };
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue