Skip to content

Instantly share code, notes, and snippets.

@noslin005
Created April 21, 2026 16:48
Show Gist options
  • Select an option

  • Save noslin005/b73437aa055833e3bfc9a0c5297318cd to your computer and use it in GitHub Desktop.

Select an option

Save noslin005/b73437aa055833e3bfc9a0c5297318cd to your computer and use it in GitHub Desktop.
PulseAudio
#!/bin/bash
set -e
echo "=== PulseAudio Setup ==="
echo "[1/5] Installing packages..."
sudo dnf install -y -q pulseaudio pulseaudio-utils alsa-plugins-pulseaudio
echo "[2/5] Restarting PulseAudio..."
pulseaudio -k 2>/dev/null || true
sleep 1
echo "[3/5] Writing config..."
mkdir -p ~/.config/pulse
cat > ~/.config/pulse/default.pa << 'EOF'
.include /etc/pulse/default.pa
load-module module-null-sink sink_name=virtual_out sink_properties=device.description=Virtual_Output
set-default-sink virtual_out
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1
EOF
cat > ~/.config/pulse/daemon.conf << 'EOF'
exit-idle-time = -1
EOF
echo "[4/5] Starting PulseAudio..."
DISPLAY=:0 pulseaudio --start
sleep 2
echo "[5/5] Verifying..."
pulseaudio --check && echo " PulseAudio: RUNNING" || { echo " PulseAudio: FAILED"; exit 1; }
pactl info | grep -E "Server|Default Sink"
echo ""
pactl list sinks short
echo ""
if [ -f /usr/share/sounds/alsa/Front_Center.wav ]; then
echo "Playing test sound..."
paplay /usr/share/sounds/alsa/Front_Center.wav && echo " Audio test: OK"
else
echo " No test sound file found — skipping playback test"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment