From 1c7787509d6597d5846ba1073f39c5168993411e Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Wed, 17 Apr 2024 19:12:20 -0700 Subject: [PATCH] Add .config/fish/functions/copy-gpg-key.fish --- dot_config/fish/functions/copy-gpg-key.fish | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 dot_config/fish/functions/copy-gpg-key.fish diff --git a/dot_config/fish/functions/copy-gpg-key.fish b/dot_config/fish/functions/copy-gpg-key.fish new file mode 100644 index 0000000..44d19f2 --- /dev/null +++ b/dot_config/fish/functions/copy-gpg-key.fish @@ -0,0 +1,14 @@ +#!/usr/bin/env fish + +function copy-gpg-key + set -f key (\ + gpg --list-secret-keys --keyid-format SHORT\ + | grep 'rsa4096' \ + | sed 's/sec rsa4096\///'\ + | awk '{print $1}'\ + ) + + copyq copy "$key" && return 0 + + return 1 +end