potential fix for status crashing until a restart

This commit is contained in:
speedie 2022-11-12 11:44:36 +01:00
parent 34f2598d8d
commit 3cb09a8709

View file

@ -4,12 +4,28 @@
STATUSBAR="speedwm-stellar" # should be stellar STATUSBAR="speedwm-stellar" # should be stellar
IN_ARGS="$@" # arguments IN_ARGS="$@" # arguments
LOADTEXT="Loading" # load text
mkdir -p $HOME/.config/speedwm/ mkdir -p $HOME/.config/speedwm/
# run status
rstatus() {
while true; do
$STATUSBAR $IN_ARGS > /tmp/statusbar-log
done
}
# run loop
statusfunc() { statusfunc() {
pgrep -x $STATUSBAR || $STATUSBAR $IN_ARGS > /tmp/statusbar-log & if pgrep -x $STATUSBAR > /dev/null; then
sleep 3 clear
printf "Status bar is already running, continuing loop."
sleep 3
else
speedwm -s "$LOADTEXT"
rstatus
fi
statusfunc statusfunc
} }