dotfiles/.config/fish/functions/pubkey.fish
2022-07-07 11:32:27 -05:00

12 lines
421 B
Fish

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