From b2fe3ec8da0a19938f76e08a338d44d398a92935 Mon Sep 17 00:00:00 2001 From: samedamci Date: Thu, 14 May 2020 12:29:22 +0200 Subject: [PATCH] Edit 'dbar' and 'refbar' scripts --- .local/bin/scripts/dbar | 2 ++ .local/bin/scripts/refbar | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.local/bin/scripts/dbar b/.local/bin/scripts/dbar index b252cd5..d0adf93 100755 --- a/.local/bin/scripts/dbar +++ b/.local/bin/scripts/dbar @@ -4,6 +4,8 @@ sym="|" # [ "$(transmission-remote -l | grep %)" ] && delay="10s" || delay="1m" delay="1m" +echo "$$" > "$HOME/.cache/dbar.pid" + cd "$HOME/.local/bin/scripts/dwmbar/" || exit 1 status() { diff --git a/.local/bin/scripts/refbar b/.local/bin/scripts/refbar index c0c58b9..e46b720 100755 --- a/.local/bin/scripts/refbar +++ b/.local/bin/scripts/refbar @@ -1,4 +1,5 @@ #!/bin/sh -pkill -SIGTRAP dbar -[ ! "$(pgrep dbar)" ] && dbar & +[ ! "$(pgrep dbar)" ] && { dbar & exit; } + +pkill -P "$(cat "$HOME/.cache/dbar.pid")" sleep