From 02db41a81ed5e875a39f69a0d9b5799ae3e85033 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 17 Jan 2017 23:22:10 -0500 Subject: [PATCH] os/arch/.xprofile: do process check for key daemons --- os/arch/.xprofile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/os/arch/.xprofile b/os/arch/.xprofile index 33853719..b646c084 100644 --- a/os/arch/.xprofile +++ b/os/arch/.xprofile @@ -3,9 +3,10 @@ export __GL_THREADED_OPTIMISATIONS=1 # Maybe start this daemon +running() { pgrep "$1" >/dev/null || "$@"; } run() { command -v "$1" >/dev/null || return - pgrep "$1" >/dev/null || $@ + running "$1" || "$@" } # failsafe @@ -33,8 +34,8 @@ run compton & # perdy effects + transparency # non-essentials run mpd & # music server run redshift & # screen temperature based on time-of-day -$HOME/.bin/rsl.sh # resilio sync +~/.bin/rsl.sh # resilio sync -# -ssh-agent -s | sed 's/^echo/#echo/' > ~/.ssh/agentenv -gpg-agent --daemon | sed 's/^echo/#echo/' > ~/.gnupg/agentenv +# key agents +running ssh-agent || { ssh-agent -s | sed 's/^echo/#echo/' \> ~/.ssh/agentenv; } +running gpg-agent || { gpg-agent --daemon | sed 's/^echo/#echo/' \> ~/.gnupg/agentenv; }