Skip to content

Commit 2441be2

Browse files
authored
fix: avoid hardcoding keyring daemon path for distros like NixOS
1 parent 4598b7c commit 2441be2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

data/start-cosmic

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,15 @@ fi
4747
# -> check if /run/user/$UID/keyring exists
4848
if [ -d "/run/user/$(id -u)/keyring" ]; then
4949

50-
# start pkcs11, secrets, and ssh components
51-
/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh
52-
export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
50+
# Use PATH lookup instead of hardcoding /usr/bin
51+
if command -v gnome-keyring-daemon >/dev/null 2>&1; then
52+
eval "$(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)"
53+
else
54+
echo "gnome-keyring-daemon not found in PATH" >&2
55+
fi
5356

57+
# Set SSH_AUTH_SOCK to the standard gnome-keyring socket
58+
export SSH_AUTH_SOCK="/run/user/$(id -u)/keyring/ssh"
5459
fi
5560

5661
# Run cosmic-session

0 commit comments

Comments
 (0)