BluetoothヘッドフォンをLinuxシステムに自動的に接続する小さなスクリプトを作成しました。
#!/bin/bash
bluetoothctl
wait ${!}
connect XX:XX:XX:XX:XX:XX #headphone MAC address
wait ${!}
exit
スクリプトは開きますbluetoothctl
が、次のコマンドは実行されません。
ベストアンサー1
bluetoothctl
次のようにシェルスクリプトでコマンドを使用できます。
bluetoothctl -- command
または:
echo -e "command\n" | bluetoothctl
たとえば、
bluetoothctl -- connect XX:XX:XX:XX:XX:XX