 Today we are going to hook to a Bluetooth speaker using our Linux shell. Obviously most distributions have a GUI interface, a graphical user interface for connecting to Bluetooth devices, but we're going to look at one of the few options we have for the shell. So let's go ahead and jump right in and see if we can get this speaker playing. As I stated, there's a few different options you have when it comes to connecting to Bluetooth devices from your Linux shell, but we're just going to use a Bluetooth control application today. You'll probably want to install these packages if you don't already have them installed. The first one here is Pulse Audio Module Bluetooth. Pulse Audio is the sound system that I'm currently using and is common on most Linux desktop distributions. The blues with a Z, blues firmware and blues 2. This blues might actually install these two, but I'm going to go ahead and just say install all those I already have them installed, so I'm just going to skip that. Now let's look at what audio outputs I have on my computer. There's two different commands you can try. If they're not installed, you can use app to install them, but Pulse Mixer is a shell based one, and here you can see I have the analog stereo. That's the audio card that's built into my motherboard, and then I also have my USB audio headphones. I'm going to hit Q to get out of that. If for a graphical interface, PAVU control, one thing in a graphical interface, you can see my two audio outputs right now. Okay, let's go ahead and we're going to go ahead and run the command Bluetooth CTL Bluetooth control, and that comes with the blues package that we just installed. We'll go ahead and enter and now we're in its interface. You can see that currently my Bluetooth device on my machine, and it is parable, but we want to find this Bluetooth speaker, so let me go ahead and power up this Bluetooth speaker. I have not connected this Bluetooth speaker to this computer yet. Turn it on and it's connected to my phone, so I'm going to put it into pairing mode. Okay, now I can type in scan on, and now we'll give it a moment and we'll scan, and there we go. That is the device I'm looking for. It gives you the name, and it gives you the MAC address. So at this point I'm going to type scan on. I'm not sure if that's needed, but I have found that if I leave scan on, lots of times it won't connect to a device. So first thing we need to do now that we found the device when we've got its MAC address is pair it. We're going to say pair, and I'll just paste in that MAC address. And it connected. If the device requires a pin, it will ask you for the pin. Next, I'm going to trust that device so that my computer sees it as a trusted device. Now that we've paired it, we've paired it. Let's go ahead and just connect to it. So connect and that MAC address, and it's connected. Let me go ahead and exit out of this interface and I will clear the screen and I will pulse, mix, and again now you can see that device is on my audio, one of my audio outputs, and right now it's set as my default device. My computer detects a new device and switched over it. Again, you can do PAVU control devices. You can see that speaker right there. So we successfully connected to it. Let's see if I do eSpeak. And I say hello world from Linux shell. Hello world from Linux shell. That came out of the Bluetooth speaker. So that's connecting Bluetooth speakers or really any Bluetooth device to your system. So short, simple. I hope you find that useful. Again, there are other options and I guess I should also mention the Bluetooth control. If you wanted to run a command, well let's go into here real quick and what I'm going to do is I'm going to, I think of course you can always type help for all your options, but what we're going to do is exit out of this and I'm going to show you that you can actually run those commands. We went into the interface but if I do scan on from here, it's going to turn scan on and start looking for devices. Of course I can control C to kill that. If I try to control scan off, it already does if I've disconnected from that. I also want to mention, so you can also obviously pair devices this way straight from the shell without going into the interface. But let me go ahead and do scan on. And if I try to scan on again, you'll get an error. It tells you right here that it's already in progress. Same if I try to scan off. So I'll scan off now. It says discovering but if I try to run it again, it'll say failed. That's because it's already off. So if you get an error, it will probably tell you the last part of the error will tell you what it is. Like if you're trying to pair and you're trying to pair again, it might tell you pairing already in progress. So you can't do something that's already been done without undoing it if that makes any sense. So thank you for watching. Please visit filmsbychrist.com That's Chris the K. There's a link in the description. Also check out my Patreon. Link in the description below as well. And I hope that you have a great day.