From 5c8a21d37786f4974ca7793beda589eb6d6f7923 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 14 Oct 2019 16:20:35 +0200 Subject: l: add pkgs.otpmenu --- lass/5pkgs/otpmenu/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lass/5pkgs/otpmenu/default.nix (limited to 'lass/5pkgs/otpmenu/default.nix') diff --git a/lass/5pkgs/otpmenu/default.nix b/lass/5pkgs/otpmenu/default.nix new file mode 100644 index 000000000..fe6d5b94c --- /dev/null +++ b/lass/5pkgs/otpmenu/default.nix @@ -0,0 +1,10 @@ +{ pkgs }: +pkgs.writeDashBin "otpmenu" '' +x=$(${pkgs.pass}/bin/pass git ls-files '*/otp.gpg' \ + | ${pkgs.gnused}/bin/sed 's:/otp\.gpg$::' \ + | ${pkgs.dmenu}/bin/dmenu +) + +otp=$(${(pkgs.pass.withExtensions (ext: [ ext.pass-otp ]))}/bin/pass otp code "$x/otp") +printf %s "$otp" | ${pkgs.xdotool}/bin/xdotool type -f - +'' -- cgit v1.2.3