8 hours ago · Tech · hide · 0 comments

Bluetooth is convenient to connect external speakers or earbuds. On Linux, you have bluez-* and blueman to manage your wireless connections, but you have to use the … mouse. My Debian runs awesomewm, and everything is about keybindings, and lightness. The mouse is a device I use when I don’t have any other option. And, to connect quickly, I use of course fzf and a little function: bt() { local device action device=$(bluetoothctl devices | fzf --height=40% --reverse \ --prompt="Select device: " \ --preview="bluetoothctl info {2}" \ | awk '{print $2}') [ -z "$device" ] && return if bluetoothctl info "$device" | grep -q "Connected: yes"; then action="disconnect" else action="connect" fi echo "$action to $(bluetoothctl info "$device" | grep Name | cut -d: -f2-)..." bluetoothctl "$action" "$device" } And, the output is: If the device is connected, it will disconnect it, and vice versa. That’s it! Once again, shell scripts are great for small things like this one.

No comments yet. Log in to reply on the Fediverse. Comments will appear here.