nickclyde / rofi-bluetooth

🔷 A script that generates a rofi menu that uses bluetoothctl to connect to bluetooth devices and display status info.
GNU General Public License v3.0
481 stars 51 forks source link

Use rfkill to unblock bluetooth adapter #5

Closed kmARC closed 3 years ago

kmARC commented 3 years ago

Power management tools such as TLP would not only power off the bluetooth adapter using bluetoothctl but also block it using rfkill.

This patch checks if the radio device is blocked using rfkill, and unblocks it in case it was. Note that after unblocking, the bluetooth subsystem needs a couple seconds to initialize, therefore 'sleep 3'.

There is no additional dependencies introduced with this patch; rfkill is part of util-linux, of which the base system depends.