Fix bluetooth

This commit is contained in:
Ryan Hughes
2026-05-19 19:59:27 -04:00
parent 1f3a827701
commit b6803aa269
4 changed files with 49 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
[Unit]
Description=Bluetooth pairing agent (auto-accept)
Documentation=man:bt-agent(1)
# bluez must be reachable on the system bus before we can register.
After=dbus.socket
Requires=dbus.socket
[Service]
Type=simple
# NoInputNoOutput auto-accepts pair requests. Safe because the adapter
# is only `pairable: true` when the user explicitly opens the omarchy
# bluetoothPanel and starts scanning; outside that window bluez refuses
# inbound pair attempts at a lower layer.
ExecStart=/usr/bin/bt-agent -c NoInputNoOutput
Restart=on-failure
RestartSec=2
[Install]
WantedBy=graphical-session.target
+7
View File
@@ -6,3 +6,10 @@ sudo sed -i 's/^#\?AutoEnable=.*/AutoEnable=false/' /etc/bluetooth/main.conf
mkdir -p ~/.config/wireplumber/wireplumber.conf.d/
cp "$OMARCHY_PATH/default/wireplumber/wireplumber.conf.d/bluetooth-a2dp-autoconnect.conf" ~/.config/wireplumber/wireplumber.conf.d/
# Quickshell.Bluetooth has no Agent API, so the omarchy-shell bluetoothPanel
# can't answer the auth prompts bluez issues during pair(). bt-agent registers
# a NoInputNoOutput agent on the system bus so pair() actually completes.
mkdir -p ~/.config/systemd/user/
cp "$OMARCHY_PATH/config/systemd/user/bt-agent.service" ~/.config/systemd/user/
systemctl --user enable bt-agent.service
+3
View File
@@ -9,6 +9,9 @@ asdcontrol
avahi
bash-completion
bat
bluez
bluez-tools
bluez-utils
bolt
brightnessctl
btop
+20
View File
@@ -0,0 +1,20 @@
echo "Install bluetooth pairing agent for the shell bluetoothPanel"
# Hold bluez explicit so a future cascade-remove (e.g. uninstalling a TUI
# that listed it as a dep) doesn't take it down with it. Idempotent if it
# already is.
omarchy-cmd-present pacman && sudo pacman -D --asexplicit bluez >/dev/null 2>&1 || true
# Quickshell.Bluetooth exposes pair()/trust()/connect() but no Agent surface,
# so the bluetoothPanel can't answer the auth prompts bluez issues during
# pair(). Without an org.bluez.Agent1 registered, pair() stalls at the
# confirmation step and the device ends up half-paired (Paired:no,
# Trusted:yes), then connect attempts fail with br-connection-key-missing.
# bluez-tools' bt-agent fills that gap; bluez-utils provides bluetoothctl
# for manual recovery.
omarchy-pkg-add bluez-utils bluez-tools
mkdir -p ~/.config/systemd/user/
cp "$OMARCHY_PATH/config/systemd/user/bt-agent.service" ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now bt-agent.service