Turn on bluetooth on login screen
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
:
- Let
bluetooth.service
be required bymulti-user.target
. I used asystemd
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
- Install the
bluez-auto-enable-devices
package to generate the requiredAutoEnable=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.
Related videos on Youtube
TomTom
Updated on September 18, 2022Comments
-
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
andbluez-utils
which provide thebluetoothhctl
utility. Also I am usingblueman
as a front-end if that is important. -
Hiwa over 4 yearsThanks, looks like it worked on 18.04 Ubuntu.
-
Cirelli94 over 3 yearsThis is deprecated, bluez.org/release-of-bluez-5-35 Look at my answer for a valid method.