1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +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"; default = "clipboard";
type = lib.types.enum [ "primary" "secondary" "clipboard" ]; type = lib.types.enum [ "primary" "secondary" "clipboard" ];
}; };
dmenu.package = lib.mkOption { dmenu = lib.mkOption {
default = pkgs.dmenu; default = "${pkgs.dmenu}/bin/dmenu -i -p klem";
type = lib.types.package; type = lib.types.path;
}; };
scripts = lib.mkOption { scripts = lib.mkOption {
default = { default = {
@@ -37,7 +37,7 @@ in pkgs.writers.writeDashBin "klem" ''
${pkgs.xclip}/bin/xclip -selection ${cfg.selection} -out \ ${pkgs.xclip}/bin/xclip -selection ${cfg.selection} -out \
| case $(echo "${ | case $(echo "${
lib.concatStringsSep "\n" (lib.attrNames cfg.scripts) 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)} ${lib.concatStringsSep "\n" (lib.mapAttrsToList scriptCase cfg.scripts)}
*) ${pkgs.coreutils}/bin/cat ;; *) ${pkgs.coreutils}/bin/cat ;;
esac \ esac \