function __refresh_gpg_agent_info -d "Re-load ~/.gpg-agent-info into environment"
	cat ~/.gpg-agent-info | sed 's/=/ /' | while read key value
		set -e $key
		set -U -x $key "$value"
	end
end

if not set -q -x GPG_AGENT_INFO
	gpg-agent --daemon >/dev/null
end

if test -f ~/.gpg-agent-info
	__refresh_gpg_agent_info

	gpg-connect-agent /bye ^/dev/null
	if test $status -eq 1
		pkill -U $USER gpg-agent
		gpg-agent --daemon >/dev/null
		__refresh_gpg_agent_info
	end
end

function __refresh_gpg_agent_info -d "Re-load ~/.gpg-agent-info into environment"
	cat ~/.gpg-agent-info | sed 's/=/ /' | while read key value
		set -e $key
		set -U -x $key "$value"
	end
end

if not set -q -x GPG_AGENT_INFO
	gpg-agent --daemon --write-env-file ~/.gpg-agent-info >/dev/null
end

if test -f ~/.gpg-agent-info
	__refresh_gpg_agent_info

	gpg-connect-agent /bye ^/dev/null
	if test $status -eq 1
		pkill -U $USER gpg-agent
		gpg-agent --daemon --write-env-file ~/.gpg-agent-info >/dev/null
		__refresh_gpg_agent_info
	end
end

Fix GPG agent env file
Fix GPG agent env file

Gres/dotfiles,Gres/dotfiles,JDevlieghere/dotfiles,JDevlieghere/dotfiles,JDevlieghere/dotfiles,Gres/dotfiles