1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00

fix(klem): make dmenu override more customizable

This commit is contained in:
Kierán Meinhardt
2020-06-16 19:50:34 +02:00
parent 90eed5cb3b
commit dfdb9d0bdb

View File

@@ -12,9 +12,9 @@ let
default = "clipboard";
type = lib.types.enum [ "primary" "secondary" "clipboard" ];
};
dmenu.package = lib.mkOption {
default = pkgs.dmenu;
type = lib.types.package;
dmenu = lib.mkOption {
default = "${pkgs.dmenu}/bin/dmenu -i -p klem";
type = lib.types.path;
};
scripts = lib.mkOption {
default = {
@@ -37,7 +37,7 @@ in pkgs.writers.writeDashBin "klem" ''
${pkgs.xclip}/bin/xclip -selection ${cfg.selection} -out \
| case $(echo "${
lib.concatStringsSep "\n" (lib.attrNames cfg.scripts)
}" | ${cfg.dmenu.package}/bin/dmenu -i -p klem) in
}" | ${cfg.dmenu}) in
${lib.concatStringsSep "\n" (lib.mapAttrsToList scriptCase cfg.scripts)}
*) ${pkgs.coreutils}/bin/cat ;;
esac \