diff --git a/bin/omarchy-restart-pipewire b/bin/omarchy-restart-pipewire index a222ad1e70..887301366d 100755 --- a/bin/omarchy-restart-pipewire +++ b/bin/omarchy-restart-pipewire @@ -2,5 +2,9 @@ # Restart the PipeWire audio service to fix audio issues or apply new configuration. -echo -e "Restarting pipewire audio service...\n" -systemctl --user restart pipewire.service +echo -e "Restarting PipeWire audio services...\n" +systemctl --user restart wireplumber.service pipewire.service + +if systemctl --user --quiet is-active pipewire-pulse.service; then + systemctl --user restart pipewire-pulse.service +fi diff --git a/default/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf b/default/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf new file mode 100644 index 0000000000..d6234ab936 --- /dev/null +++ b/default/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf @@ -0,0 +1,18 @@ +## Auto-connect A2DP playback/capture profiles on Bluetooth devices. +## This helps speakers and receivers expose their audio profiles without +## requiring manual PipeWire/WirePlumber recovery. + +monitor.bluez.rules = [ + { + matches = [ + { + device.name = "~bluez_card.*" + } + ] + actions = { + update-props = { + bluez5.auto-connect = [ a2dp_sink a2dp_source ] + } + } + } +] diff --git a/install/config/hardware/bluetooth.sh b/install/config/hardware/bluetooth.sh index 65fc90d122..2157f07bee 100644 --- a/install/config/hardware/bluetooth.sh +++ b/install/config/hardware/bluetooth.sh @@ -1,2 +1,6 @@ # Turn on bluetooth by default chrootable_systemctl_enable bluetooth.service + +mkdir -p ~/.config/wireplumber/wireplumber.conf.d/ +cp $OMARCHY_PATH/default/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf \ + ~/.config/wireplumber/wireplumber.conf.d/ diff --git a/migrations/1776346552.sh b/migrations/1776346552.sh new file mode 100644 index 0000000000..b602340e3b --- /dev/null +++ b/migrations/1776346552.sh @@ -0,0 +1,14 @@ +set -e + +echo "Enable Bluetooth A2DP auto-connect in WirePlumber" + +destination=~/.config/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf + +mkdir -p ~/.config/wireplumber/wireplumber.conf.d/ + +if [[ ! -f "$destination" ]]; then + cp "$OMARCHY_PATH/default/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf" \ + "$destination" +fi + +omarchy-restart-pipewire