configs  Check-in [98e97b3581]

Overview
Comment:zshrc: Improve finding GnuPG SSH socket
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 98e97b35817aa431dc1b8071cc078e6d7ce7104a8b08ddad8d8538255c11dd5d
User & Date: js on 2023-04-30 10:39:16
Other Links: manifest | tags
Context
2023-05-27
18:45
Remove remnants of sway check-in: 4d9fdaadd5 user: js tags: trunk
2023-04-30
10:39
zshrc: Improve finding GnuPG SSH socket check-in: 98e97b3581 user: js tags: trunk
10:27
Add scdaemon.conf check-in: 54de3688fa user: js tags: trunk
Changes

Modified zshrc from [a58c784780] to [55f2cb5fbf].

365
366
367
368
369
370
371
372
373
374
375
376
377
378

379
380
381


382
383
384
385
386
387
388
365
366
367
368
369
370
371







372



373
374
375
376
377
378
379
380
381







-
-
-
-
-
-
-
+
-
-
-
+
+







# mpv does not like locales that use , as decimal point.
__has_command mpv && alias mpv="LC_ALL=C mpv"

if __has_command gpg gpg2; then
	# Make sure GPG agent is running.
	gpg --card-status &>/dev/null

	local sock
	if [ -d "$XDG_RUNTIME_DIR/gnupg" ]; then
		sock=$(find "$XDG_RUNTIME_DIR/gnupg" -name S.gpg-agent.ssh |
		       head -1)
	fi
	[ -n "$sock" ] || sock="$GNUPGHOME/S.gpg-agent.ssh"

	alias gssh='SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) ssh -o IdentitiesOnly=no'
	alias gssh="SSH_AUTH_SOCK=$sock ssh -o IdentitiesOnly=no"
	alias gssh-add="SSH_AUTH_SOCK=$sock ssh-add"
	alias gsftp="SSH_AUTH_SOCK=$sock sftp -o IdentitiesOnly=no"
	alias gssh-add='SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) ssh-add'
	alias gsftp='SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) sftp -o IdentitiesOnly=no'
fi

if __has_command cryptopassphrase; then
	pwnk() {
		local clipboard
		if __has_command wl-copy; then
			clipboard=wl-copy