1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

fix(klem): rename clipboardSelection to selection

This commit is contained in:
Kierán Meinhardt
2020-06-16 19:17:56 +02:00
parent 4443d065ed
commit 90eed5cb3b

View File

@@ -8,7 +8,7 @@ let
_file = toString ./klem.nix;
imports = [ (args.config or { }) ];
options = {
clipboardSelection = lib.mkOption {
selection = lib.mkOption {
default = "clipboard";
type = lib.types.enum [ "primary" "secondary" "clipboard" ];
};
@@ -20,7 +20,8 @@ let
default = {
pastebin = "${pkgs.curl}/bin/curl -fSs -F 'f:1=<-' ix.io";
shorten = ''
${pkgs.curl}/bin/curl -fSs -F "shorten=$(${pkgs.coreutils}/bin/cat)" https://0x0.st'';
${pkgs.curl}/bin/curl -fSs -F "shorten=$(${pkgs.coreutils}/bin/cat)" https://0x0.st
'';
"replace p.r" = "${pkgs.gnused}/bin/sed 's/\\<r\\>/krebsco.de/'";
};
type = lib.types.attrs;
@@ -33,7 +34,7 @@ let
'${option}') ${toString script} ;;
'';
in pkgs.writers.writeDashBin "klem" ''
${pkgs.xclip}/bin/xclip -selection ${cfg.clipboardSelection} -out \
${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
@@ -41,5 +42,5 @@ in pkgs.writers.writeDashBin "klem" ''
*) ${pkgs.coreutils}/bin/cat ;;
esac \
| tr -d '\r\n' \
| ${pkgs.xclip}/bin/xclip -selection ${cfg.clipboardSelection} -in
| ${pkgs.xclip}/bin/xclip -selection ${cfg.selection} -in
''