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