Turn on bluetooth on login screen

9,013

Solution 1

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.

Solution 2

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

Solution 3

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.

Share:
9,013

Related videos on Youtube

TomTom
Author by

TomTom

Updated on September 18, 2022

Comments

  • TomTom
    TomTom over 1 year

    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.

  • Hiwa
    Hiwa over 4 years
    Thanks, looks like it worked on 18.04 Ubuntu.
  • Cirelli94
    Cirelli94 over 3 years
    This is deprecated, bluez.org/release-of-bluez-5-35 Look at my answer for a valid method.