Unlock keyring on ssh use

I have my ssh key passphrase stored in the gnome keyring, but when I ssh to a host for the first time I get a GUI prompt for the ssh passphrase not the keyring password.

I can manually go and unlock the keying before first use of ssh, but it’s a bit annoying. Is there a way to change this behaviour?

This is what I do on KDE, I assume you can do the same on Gnome.

I add a startup-task that runs a script that loads my SSH keys (I have move then 1).
The short version of that script is:

#!/bin/bash
# always have the SSH keys loaded
ssh-add ~/.ssh/id_ed25519 </dev/null

You may need to set SSH_ASKPASS=/usr/bin/ksshaskpass. I do that with these lines in
my .bash_profile.

if [ -e "${SSH_ASKPASS:=/usr/bin/ksshaskpass}" ]
then
    export GIT_ASKPASS=${SSH_ASKPASS}
    export SSH_ASKPASS
fi

Having set that all up, logout then log back in.

The first time you will see a GUI prompt for the ssh id passphrase/.
It will be stored in the keyring and used automatically the next time you login.

Normally, GNOME keyring is automatically unlocked at login using your login password, but this does not happen if you have automatic login enabled.
As a workaround, you can change the keyring password to blank using Seahorse.

I’d already set a blank password in Seahorse, but that seems to not be sufficient.

After some more digging around I’ve found I can issue the unlock command to the keyring as follows

echo | gnome-keyring-daemon --replace --unlock --daemonize

So I’m thinking to create a systemd service to run that on login. I dunno, feels maybe there should be an easier way?