22 lines
532 B
Bash
Executable File
22 lines
532 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Initialize pipewire audio by attempting to play sound until it succeeds
|
|
# This ensures pipewire is fully ready before fenrir starts
|
|
|
|
maxAttempts=30
|
|
attempt=0
|
|
|
|
while [[ $attempt -lt $maxAttempts ]]; do
|
|
# Try to play a silent sound using sox
|
|
if play -qnV0 synth .1 whi norm -100 2>/dev/null; then
|
|
# Success! Pipewire is working
|
|
exit 0
|
|
fi
|
|
|
|
# Wait a moment before trying again
|
|
sleep 1
|
|
((attempt++))
|
|
done
|
|
|
|
# Even if we failed, exit successfully so we don't block boot
|
|
exit 0
|