Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 ]
}
}
}
]
4 changes: 4 additions & 0 deletions install/config/hardware/bluetooth.sh
Original file line number Diff line number Diff line change
@@ -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/
7 changes: 7 additions & 0 deletions migrations/1776346552.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
echo "Enable Bluetooth A2DP auto-connect in WirePlumber"

mkdir -p ~/.config/wireplumber/wireplumber.conf.d/
cp $OMARCHY_PATH/default/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf \
~/.config/wireplumber/wireplumber.conf.d/
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migration always overwrites an existing user rule file if it’s already present (e.g., a user may have created/tuned the same file as a workaround). Consider making this idempotent by only copying when the destination file doesn’t exist, or by backing up the existing file before overwriting it.

Suggested change
cp $OMARCHY_PATH/default/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf \
~/.config/wireplumber/wireplumber.conf.d/
destination=~/.config/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf
if [ ! -f "$destination" ]; then
cp "$OMARCHY_PATH/default/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf" \
"$destination"
fi

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in fbb1e2b. The migration now keeps an existing ~/.config/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf in place instead of overwriting a user workaround file.


omarchy-restart-pipewire
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the cp fails (missing source file, permissions, etc.), the script will still likely exit successfully because omarchy-restart-pipewire runs afterwards and becomes the migration’s exit code. Add set -e (or explicitly check the cp result) so the migration reliably fails when the file cannot be installed.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in fbb1e2b. The migration now uses set -e, so a failed install of the WirePlumber drop-in stops the migration instead of being masked by the restart helper.

Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migration restarts pipewire.service only, but the new setting is a WirePlumber rule; restarting PipeWire alone may not reload WirePlumber configuration. To ensure the rule is applied immediately, also restart the WirePlumber user service (and, if needed, pipewire-pulse) or update the restart helper used here accordingly.

Suggested change
omarchy-restart-pipewire
systemctl --user restart wireplumber.service pipewire.service
if systemctl --user --quiet is-active pipewire-pulse.service; then
systemctl --user restart pipewire-pulse.service
fi

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in fbb1e2b. omarchy-restart-pipewire now restarts wireplumber.service and pipewire.service, and also restarts pipewire-pulse.service when it is active, so this migration reloads the new WirePlumber rule immediately.

Loading