case "$1" in "connect" ) { x=$(bluetoothctl devices | sk | sd '^Device ' '' | sd ' .+$' '') && { bluetoothctl connect "$x" } };; "disconnect" ) { bluetoothctl disconnect };; * ) { echo "unknown command" };; esac