You are not logged in.
I am not completely sure of the terminology but some commands just run straight from your terminal (ex: ip) whereas others expect you to run a process first, run the commands you desire, then exit the process (example: iwctl) from my research i believe the latter are called interactive programs, but i am unsure. My question is simply how do you go about scripting with the framework of something like bluetoothctl; specifically im getting into dmenu (specifically a clone for wayland) and want to start working on a script to let me control my audio interfaces.
do i need to use something like expect to accomplish this?
https://man.archlinux.org/man/expect.1.en
or is additional configuration unnecessary and are there commands that exist outside of bluetoothctl that i should be using instead?
testyy() {
bluetoothctl
connect <mac_address>
quit
}running this function does not seem to work how it works when each is inputted by a human into commandline
Last edited by efog4 (2025-11-17 20:22:15)
Offline
"expect" can lead a dialog w/ the process (waiting for and interpreting responses) but in your case you can typically just use heredocs as input and documented in https://man.archlinux.org/man/bluetoothctl.1#AUTOMATION
Offline
hey!
ah yes, "here document" ; i dont think i would have ever found this through search enginning
thanks, seth
Offline