Update Makefile compatibility and add default for TMPDIR in SSH agent start.

This commit is contained in:
Hans Goor 2025-06-22 14:24:45 +01:00
parent a7ea377432
commit f257b5b2d3
Signed by: eyedevelop
SSH key fingerprint: SHA256:Td89veptDEwCV8J3fjqnknNk7SbwzedYhauyC2nFBYg
2 changed files with 6 additions and 5 deletions

View file

@ -8,7 +8,7 @@ FONTS_TO_INSTALL ?= FiraCode FiraMono Hack
LOCAL_TOOLS_BIN ?= $(HOME)/.local/bin
STOW_TARGET ?= $(HOME)
STOW := $(shell command -v stow 2>/dev/null)
STOW := $(shell command -v /usr/bin/stow 2>/dev/null)
# Compile stow if it doesn't exist
ifeq ($(STOW),)

View file

@ -1,12 +1,13 @@
#!/bin/bash
TMPDIR="${TMPDIR:-${XDG_RUNTIME_DIR}}"
if [[ -z "${SSH_CONNECTION}" ]]; then
if ! pgrep -u "$USER" ssh-agent >/dev/null; then
ssh-agent > "$TMPDIR/ssh-agent.env"
if ! pgrep -u "${USER}" ssh-agent >/dev/null; then
ssh-agent > "${TMPDIR}/ssh-agent.env"
fi
if [[ ! -f "${SSH_AUTH_SOCK}" ]]; then
source "$TMPDIR/ssh-agent.env" >/dev/null
source "${TMPDIR}/ssh-agent.env" >/dev/null
fi
fi