fix: avoid hardcoding keyring daemon path for distros like NixOS

This commit is contained in:
Aaron Honeycutt 2025-09-05 13:35:34 -06:00 committed by GitHub
parent 4598b7cdf4
commit 2441be2ad0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,10 +47,15 @@ fi
# -> check if /run/user/$UID/keyring exists
if [ -d "/run/user/$(id -u)/keyring" ]; then
# start pkcs11, secrets, and ssh components
/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh
export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
# Use PATH lookup instead of hardcoding /usr/bin
if command -v gnome-keyring-daemon >/dev/null 2>&1; then
eval "$(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)"
else
echo "gnome-keyring-daemon not found in PATH" >&2
fi
# Set SSH_AUTH_SOCK to the standard gnome-keyring socket
export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
fi
# Run cosmic-session