1
0

zsh: optimize gpg-agent initialization
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Konstantin Demin 2024-12-19 20:50:46 +03:00
parent 4e67805847
commit 5cfbe03d71
Signed by: krd
GPG Key ID: 4D56F87A8BA65FD0

View File

@ -6,12 +6,17 @@ z-gpg-agent() {
(( ${+commands[gpg-agent]} )) || return 127 (( ${+commands[gpg-agent]} )) || return 127
local u if (( ${+commands[systemctl]} )) ; then
for u in gpg-agent.{service,socket} ; do local u s
z-systemctl-exists --user $u || continue for u in gpg-agent.{service,socket} ; do
s=$(z-systemctl --user is-enabled $u)
z-systemctl --user --now enable $u case "$s" in
done disabled ) ;;
* ) continue ;;
esac
z-systemctl --user --now enable $u
done
fi
(( ${+commands[gpgconf]} )) || return 127 (( ${+commands[gpgconf]} )) || return 127