3 ms·
Got back to my laptop, here it is (extremely hacky): https://gist.github.com/danielzfranklin/bb4848ffda1d44b437e2a9d7c8a8f3f5 https://gist.github.com/danielzfra
by iudqnolq 7y ago
Got back to my laptop, here it is (extremely hacky): https://gist.github.com/danielzfranklin/bb4848ffda1d44b437e2a9d7c8a8f3f5 https://gist.github.com/danielzfranklin/bb4848ffda1d44b437e2...
All commands you enter pass directly to bluetoothctl except aliases in curly braces are replaced. You can use it interactively or pipe to it.
Complex piped stuff may or may not actually work. If stdin isn't a tty the program exits once bluetoothctl reports a success/failure after it gets an EOF on stdin. This means you can write `btctl <<< "connect {my_device_alias}"` and it will exit once it's done connecting or couldn't connect.
If you're using it interactively it only waits 0.01 seconds for results before displaying them and moving on to the next input() (whereas bluetoothctl will asynchronously display more results even while you're typing in a new input) so you may need to spam enter to see results.