Rofi is extensible via scripts. rofi-bluetooth-script
is such a script and allows you to manage your bluetooth connections with rofi.
This project is a thin python wrapper around bluetoothctl
from the Bluez project and those two are the only requirements:
- python3
- bluetoothctl
xi python bluez
- Place script in
~/.config/rofi/scripts
- Add
rofi-bluetooth
tomodes
variable in rofi config - Optionally, add something like
display-rofi-bluetooth: " ๏ ";
to rofi config if you use a nerd font
Rofi stays responsive after putting the bluetooth adapter into the "Discovering" state to scan for new devices. This is achieved by forking off a timeout 30s bluetoothctl scan on
using python's Popen(..., shell=True)
and bash's coproc()
.
Inspired by nickclyde's rofi-bluetooth, which is a standalone script that calls rofi in dmenu-mode. It gets the job done at least as well as this script, but I couldn't find a way to combine it with other modes in one rofi window.