aports/community/gcr4/gcr-ssh-agent-wrapper
knuxify 27deb9d172 community/gcr4: add gcr-ssh-agent and autostart wrapper
This adds a new subpackage, gcr-ssh-agent, which replaces the old
gcr-ssh-agent subpackage from community/gcr.

It also adds three files used for autostart:
  - /etc/xdg/autostart/gcr-ssh-agent.desktop - the autostart .desktop file,
    points to the wrapper.
  - /usr/libexec/gcr-ssh-agent-wrapper - wrapper that automatically sets up
    the basedir for the current user ID.
  - /etc/profile.d/30-gcr-ssh-agent.sh - sets up SSH_AUTH_SOCK variable
    (used by apps to figure out which SSH agent to use).

Lastly, it drops gcr-ssh-agent from the required dependencies of the gcr
package. This is to make sure that it is only installed when directly
requested by the user.

Fixes #15965.
2024-05-11 07:55:28 +00:00

15 lines
294 B
Bash
Executable File

#!/bin/sh
UID="$(id -u)"
if [ ! "$UID" ]; then exit 1; fi
# Create base directory for the ssh-agent socket.
GCR_BASE_DIR="/run/user/$UID/gcr"
if [ -e "$GCR_BASE_DIR" ]; then
rm -rf "$GCR_BASE_DIR"
fi
mkdir -p "$GCR_BASE_DIR"
/usr/libexec/gcr-ssh-agent --base-dir "$GCR_BASE_DIR" $*
exit $?