Hi,

I have a sound bar which is using bluetooth. My problem is that while my machine (Fedora 33) starts and bluetooth is starting, it doesn't auto pair and I have to click "connect" manually each boot.

So I'm trying to create a workaround. I've created a simple systemd file which runs a script that uses bluetoothctl to pair between the two.

My systemd file looks like this:

[Unit]
Description=Fix Pulse Audio
After=bluetooth.target
Requisite=bluetooth.target

[Service]
ExecStart=/usr/local/bin/fixaudio.sh
User=hetz
Type=Simple

[Install]
WantedBy=multi-user.target bluetooth.target

My script (fixaudio.sh):

#!/bin/bash

sleep 3
echo "Trying to pair...."
rm -f /tmp/fix.log
bluetoothctl connect C4:30:18:A0:2F:33 > /tmp/fix.log

The problem: any time I try to restart the bluetooth service, it ignores this systemd file (and yes, it's enabled and I ran systemctl daemon-reload)

I tried to edit the bluetooth.service file and add BindsTo=fix.service (which is the name of the systemd file), but as soon as I ran the systemctl daemon-reload - it restarted the bluetooth in a loop.

Any suggestions?

Thanks