mirror of
https://codeberg.org/andyscott/dotfiles.git
synced 2024-12-21 17:33:11 -05:00
28 lines
919 B
Bash
28 lines
919 B
Bash
#!/bin/sh
|
|
|
|
user=$(id -u)
|
|
time=$(date +"%b %d, %Y %T")
|
|
wire_log=$XDG_STATE_HOME/wireplumber.log
|
|
pipe_log=$XDG_STATE_HOME/pipewire.log
|
|
pulse_log=$XDG_STATE_HOME/pipewire-pulse.log
|
|
|
|
echo "--- $time ---" > "$wire_log"
|
|
echo "--- $time ---" > "$pipe_log"
|
|
echo "--- $time ---" > "$pulse_log"
|
|
|
|
# Kill any running pipewire processes
|
|
killall -q wireplumber & killall -q pipewire-pulse & killall -q pipewire
|
|
|
|
# Wait for processes to stop
|
|
while pgrep -u "$user" -x wireplumber >/dev/null; do sleep 1; done
|
|
while pgrep -u "$user" -x pipewire >/dev/null; do sleep 1; done
|
|
while pgrep -u "$user" -x pipewire-pulse >/dev/null; do sleep 1; done
|
|
|
|
# Wait for xdg-desktop-portal to start
|
|
until pgrep -u "$user" -f /usr/lib/xdg-desktop-portal >/dev/null; do sleep 1; done
|
|
|
|
# Launch pipewire
|
|
/usr/bin/wireplumber 2>&1 | tee -a "$wire_log" &
|
|
/usr/bin/pipewire 2>&1 | tee -a "$pipe_log" &
|
|
/usr/bin/pipewire-pulse 2>&1 | tee -a "$pulse_log" &
|
|
|