7

Is it possible to have bluetooth turned on and use a bluetooth keyboard when at the login screen? So far I only managed to start the bluetooth daemon when logged in. I added it to systemd with systemctl enable bluetooth, so it starts when I am in my user, although it is turned off by default which I'd like to fix as well.

I installed the bluez and bluez-utils which provide the bluetoothhctl utility. Also I am using blueman as a front-end if that is important.

4 Answers 4

6

By default, the Bluetooth adapter does not power on after a reboot.

So, if you want to auto power-on after boot you need to add the line AutoEnable=true in the configuration file /etc/bluetooth/main.conf at the bottom in the [Policy] section:

/etc/bluetooth/main.conf
------------------------------------------------------------------------------
[Policy]
AutoEnable=true

Note: The former method by using hciconfig hci0 up is deprecated.

Source: Arch Wiki

2

Like most of the time I didn't read the Arch Wiki carefully enough. There is a section on how to have the device active after booting.

You need to set a udev rule and to do so create /etc/udev/rules.d/10-local.rules with the following code

# Set bluetooth power up
ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"

That's it... it should now work, even without X running.

2
1

This solution worked for me on OpenSUSE Tumbleweed using systemd:

  1. Let bluetooth.service be required by multi-user.target. I used a systemd drop-in directory to implement it:
mkdir /etc/systemd/system/bluetooth.service.d
cat > /etc/systemd/system/bluetooth.service.d/multi-user.conf << EOF
[Install]
WantedBy=bluetooth.target multi-user.target
EOF
systemctl enable bluetooth.service
  1. Install the bluez-auto-enable-devices package to generate the required AutoEnable=true configuration in /etc/bluetooth/main.conf:
zypper in -y bluez-auto-enable-devices

After reboot, my bluetooth keyboard and mouse works on the login screen as well. No need to open the laptop lid and use the laptop's keyboard for login.

-1

In latest kernel I had to use:

# Set bluetooth power up
ACTION=="add", KERNEL=="hci0", RUN+="/bin/bluetoothctl --agent menu power on"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.