From ef1e07f1f42da2d3499ff27cdc6998346f322991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Sat, 2 Oct 2021 11:03:02 +0200 Subject: [PATCH] gpg: Run agent conditionally --- autostart/services/gpg-agent.service | 1 + zsh/zprofile.j2 | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/autostart/services/gpg-agent.service b/autostart/services/gpg-agent.service index 32dc098..802e190 100644 --- a/autostart/services/gpg-agent.service +++ b/autostart/services/gpg-agent.service @@ -1,6 +1,7 @@ [Unit] BindsTo=autostart.target After=windowmanager.target +ConditionPathExists=%h/.var/run/features/gpg_agent [Service] Type=forking diff --git a/zsh/zprofile.j2 b/zsh/zprofile.j2 index f6da2b0..89b0d83 100644 --- a/zsh/zprofile.j2 +++ b/zsh/zprofile.j2 @@ -64,6 +64,10 @@ mkdir -p "${FEATURE_DIR}" [[ $MACHINE_TYPE == "laptop" ]] && touch "${FEATURE_DIR}"/matchine_is_laptop +{% if user.gpg_agent %} +touch "${FEATURE_DIR}"/gpg_agent +{% endif %} + # Make all environment variables also usable in the systemd user instancee systemctl --user import-environment