Add .config/fish/functions/copy-gpg-key.fish
This commit is contained in:
parent
6ee8cbffa2
commit
1c7787509d
1 changed files with 14 additions and 0 deletions
14
dot_config/fish/functions/copy-gpg-key.fish
Normal file
14
dot_config/fish/functions/copy-gpg-key.fish
Normal file
|
@ -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
|
Loading…
Reference in a new issue