dotfiles-old/.local/scripts/pipewire.sh

30 lines
477 B
Bash
Raw Normal View History

2022-03-10 03:42:22 +00:00
#!/bin/sh
#programs to run to initialize pipewire, separated by spaces
PROGS="pipewire pipewire-pulse wireplumber"
#program to check to see if script is already running, should be one of the above programs
CHK_PROG="wireplumber"
trap 'kill' 2
trap 'kill' 15
kill() {
for PRG in $PROGS
do
pkill -KILL "$PRG"
sleep 1
done
}
if [ -z "$(pgrep $CHK_PROG)" ]; then
for PRG in $PROGS
do
"$PRG" &
sleep 1
done
wait
fi