#!/bin/bash START_TIME=`date +"%b %d, %Y %T"` LOG_FILE="${XDG_STATE_HOME}"/waybar.log echo "--- ${START_TIME} ---" > "$LOG_FILE" # Terminate already running bar instances killall -q waybar # Wait until the processes have been shut down while pgrep -u $UID -x waybar >/dev/null; do sleep 1; done # Make sure pipewire-pulse is running or module won't load until pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done # Launch Waybar waybar 2>&1 | tee -a "$LOG_FILE" & disown