Another Japan in the World

Jun Aruga's blog.

i3: Setup bluetooth keyboard

I did set up my bluetooth keyboard by the company Golodtouch by command line on the i3 window manager on Fedora 34.

Here are the list I checked to do it. I referred the [1][2][3].

Check the bluetooth service.

$ systemctl status bluetooth

Check if the bluetooth device is blocked with software level or hardware level. In my case, I unblocked the bluetooth with software level.

$ rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
  Soft blocked: yes
  Hard blocked: no
2: phy0: Wireless LAN
  Soft blocked: no
  Hard blocked: no

$ sudo rfkill unblock 0

$ rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
  Soft blocked: no
  Hard blocked: no
2: phy0: Wireless LAN
  Soft blocked: yes
  Hard blocked: no
3: hci0: Bluetooth
  Soft blocked: no
  Hard blocked: no

Did paring the bluetooth keyboard. The key board requires to send pass key. The MAC address of the keyboard is masked by me on this page.

$ sudo bluetoothctl
[bluetooth]# agent KeyboardOnly
Agent is already registered

[bluetooth]# agent KeyboardOnly 
Agent is already registered

[bluetooth]# agent off
Agent unregistered
[CHG] Controller XX:XX:XX:XX:XX:C8 Pairable: no

[bluetooth]# agent KeyboardOnly 
Agent registered
[CHG] Controller XX:XX:XX:XX:XX:C8 Pairable: yes

[bluetooth]# default-agent
Default agent request successful

[bluetooth]# power on
Changing power on succeeded

Push a connect button on the bluetooth keyboard.

Some devices might be detected with the name. in the Goldtouch keyboard, it was not. This is just an example.

[bluetooth]# scan on
Discovery started
...
[CHG] Device XX:XX:XX:XX:XX:05 Name: XXXXX 

Some device might require pass code.

[bluetooth]# pair XX:XX:XX:XX:XX:05
Attempting to pair with XX:XX:XX:XX:XX:05
[CHG] Device XX:XX:XX:XX:XX:05 Connected: yes
[agent] PIN code: NNNNNN

[bluetooth]# trust XX:XX:XX:XX:XX:05
[CHG] Device XX:XX:XX:XX:XX:05 Trusted: yes

[bluetooth]# trust XX:XX:XX:XX:XX:05
[CHG] Device XX:XX:XX:XX:XX:05 Trusted: yes
Changing XX:XX:XX:XX:XX:05 trust succeeded

[bluetooth]# connect XX:XX:XX:XX:XX:05
Attempting to connect to XX:XX:XX:XX:XX:05
[CHG] Device XX:XX:XX:XX:XX:05 Connected: yes
Connection successful

[bluetooth]# quit

You can see the bluetooth device it now.

$ sudo bluetoothctl 
Agent registered
[CHG] Controller XX:XX:XX:XX:XX:C8 Pairable: yes
[Goldtouch Bluetooth Keyboard]# devices
Device XX:XX:XX:XX:XX:05 Goldtouch Bluetooth Keyboard

This is how to remove a bluetooth device.

[bluetooth]# devices 
Device XX:XX:XX:XX:XX:05 Goldtouch Bluetooth Keyboard

[bluetooth]# remove XX:XX:XX:XX:XX:05
[DEL] Device XX:XX:XX:XX:XX:05 Goldtouch Bluetooth Keyboard
Device has been removed