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