summaryrefslogtreecommitdiff
blob: e2c50188365f479673e89f0a19558b50b080d8ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Agents startup file
#
# This file is sourced at Plasma startup, so that
# the environment variables set here are available
# throughout the session.
#
# Uncomment the following lines to start gpg-agent
# and/or ssh-agent at Plasma startup.
# If you do so, do not forget to uncomment the respective
# lines in PLASMADIR/shutdown/agent-shutdown.sh to
# properly kill the agents when the session ends.
#
# If using gpg-agent for ssh instead of ssh-agent, a GUI pinentry program
# must be selected either with eselect pinentry or adding an entry to
# $HOME/.gnupg/gpg-agent.conf such as "pinentry-program /usr/bin/pinentry-qt4".
#
# pinentry-curses or pinentry-tty will not work because the agent started here
# is in a different tty than where it is used, so the agent does not know where
# to request the passphrase and fails.

#GPG_AGENT=true
#SSH_AGENT=true
#SSH_AGENT=gpg # use gpg-agent for ssh instead of ssh-agent

if [ "${GPG_AGENT}" = true ]; then
	if [ -x /usr/bin/gpgconf ]; then
		gpgconf --launch gpg-agent >/dev/null 2>&1
		if [ $? = 2 ]; then
			eval "$(/usr/bin/gpg-agent --enable-ssh-support --daemon)"
		fi
	fi
fi

if [ "${SSH_AGENT}" = true ]; then
	if [ -x /usr/bin/ssh-agent ]; then
		eval "$(/usr/bin/ssh-agent -s)"
	fi
elif [ "${SSH_AGENT}" = gpg ] && [ "${GPG_AGENT}" = true ]; then
	if [ -e /run/user/$(id -ru)/gnupg/S.gpg-agent.ssh ]; then
		export SSH_AUTH_SOCK=/run/user/$(id -ru)/gnupg/S.gpg-agent.ssh
	elif [ -e "${HOME}/.gnupg/S.gpg-agent.ssh" ]; then
		export SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh
	fi
fi

# Uncomment the following lines to start rxvt-unicode which has the ability to
# run multiple terminals in one single process, thus starting up faster and
# saving resources.
# The --opendisplay ensures that the daemon quits when the X server terminates,
# therefore we don't need matching lines in agent-shutdown.sh.

#if [ -x /usr/bin/urxvtd ]; then
#	/usr/bin/urxvtd --opendisplay --fork --quiet
#fi