Autoconnect of Bluetooth speaker

I’ve tried a lot things that I found in the internet to get Manjaro (KDE Plasma) to get my bluetooth speakers automatically connected after login (that I’ve got to work), but when the computer goes to sleep an will be waked up i found no way to get this automatically connected again.
For startup after login, I’ve put a script into the KDE Autostart Menu, but this works only after reboot, I tried also to put this script into a service, also no success. Here my small script:

#!/bin/sh
sleep 30s
bluetoothctl connect F4:4E:FD:D0:60:21

This here ist the thing I tried noch success:

I’m sure, that there must be a solution. Thanks in advance for any hints

For resume from sleep I would not use a fixed sleep in autostart; it only runs at login. A cleaner test is a small user systemd unit triggered after suspend, or KDE’s power-management scripts if you prefer GUI tools. Before that, check whether Bluetooth itself is powered after wake with bluetoothctl show and whether the device is still trusted/paired with info F4:4E:FD:D0:60:21. If it is powered off after resume, the reconnect script is chasing the wrong problem.

2 Likes

Most Manjaro desktops will use NetworkManager, however, some Manjaro installations may use systemd-networkd, so the first thing to do might be to establish which you are using:

systemctl is-active NetworkManager systemd-networkd

You will get a response of active or inactive for each, in the order that they were listed in the command.

If NetworkManager is active; try:

sudo systemctl restart NetworkManager

Or, if systemd-networkd is active; try:

sudo systemctl restart systemd-network

This may solve the issue.

Regards.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.