dotfiles/.config/fish/functions/pubkey.fish

12 lines
421 B
Fish
Raw Normal View History

2022-07-07 18:32:27 +02:00
function pubkey -d "Copy SSH pubkey to clipboard"
if type -q xclip
command cat "$HOME/.ssh/id_ed25519.pub" | command xclip -selection clipboard
command echo "==> SSH public key copied"
else if type -q xsel
command cat "$HOME/.ssh/id_ed25519.pub" | command xsel -ib
command echo "==> SSH public key copied"
else
command echo "ERROR: xclip or xsel not found"
end
end