dotfiles/dot_local/bin/executable_waybar-launcher

20 lines
487 B
Text
Raw Normal View History

2023-06-16 00:44:03 -04:00
#!/bin/bash
2023-06-17 00:03:57 -04:00
START_TIME=`date +"%b %d, %Y %T"`
LOG_FILE="${XDG_STATE_HOME}"/waybar.log
echo "--- ${START_TIME} ---" > "$LOG_FILE"
2023-06-16 00:44:03 -04:00
# 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
2023-06-17 00:03:57 -04:00
waybar 2>&1 | tee -a "$LOG_FILE" & disown
2023-06-16 00:44:03 -04:00