From 3cb09a8709b38083faa93e00ce2f559c02fe7ad0 Mon Sep 17 00:00:00 2001 From: speedie Date: Sat, 12 Nov 2022 11:44:36 +0100 Subject: [PATCH] potential fix for status crashing until a restart --- scripts/speedwm_status | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/speedwm_status b/scripts/speedwm_status index 5315b6c..c6bc527 100755 --- a/scripts/speedwm_status +++ b/scripts/speedwm_status @@ -4,12 +4,28 @@ STATUSBAR="speedwm-stellar" # should be stellar IN_ARGS="$@" # arguments +LOADTEXT="Loading" # load text mkdir -p $HOME/.config/speedwm/ +# run status +rstatus() { + while true; do + $STATUSBAR $IN_ARGS > /tmp/statusbar-log + done +} + +# run loop statusfunc() { - pgrep -x $STATUSBAR || $STATUSBAR $IN_ARGS > /tmp/statusbar-log & - sleep 3 + if pgrep -x $STATUSBAR > /dev/null; then + clear + printf "Status bar is already running, continuing loop." + sleep 3 + else + speedwm -s "$LOADTEXT" + rstatus + fi + statusfunc }