You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotfiles/scripts/.bin/btmenu

20 lines
406 B
Bash

#!/bin/bash
if command -v myrofi >/dev/null 2>&1;
then
program="myrofi -no-show-icons -dmenu"
else
program="dmenu"
fi
bluetoothctl power on
bluetoothctl agent on
bluetoothctl default-agent
# bluetoothctl scan on
list=$(bluetoothctl paired-devices);
device=$(echo -ne "$list" | cut -d' ' -f 3- | $program "$@" )
addr=$(echo "$list" | grep "$device" | cut -d' ' -f2)
bluetoothctl connect "$addr"