nixos-config/pkgs/cpypsk.nix
2024-10-05 15:08:00 +02:00

14 lines
283 B
Nix

{ pkgs, pash, ... }:
pkgs.writeScript "cpypsk" ''
#!/bin/sh
D="''${PASH_DIR:-$HOME/.local/share/pash}"
D="''${D%/}"
for f in "$D"/*.gpg; do
n="''${f#$D/}"
n="''${n%.gpg}"
printf '%s\n' "$n"
done | ${pkgs.rofi}/bin/rofi -dmenu | xargs ${pash}/bin/pash copy
''