 Hello, I'm going to try to do this video all in one take but I'm going to have to move the camera around a little bit so we'll see how this goes. So on a Unix or a Unix-like system such as Linux, you've probably heard, maybe you haven't, but you'll hear that everything is a file and that is true. Your keyboard and your mouse and your webcam, you can read them all as text files. You can just cat them out. Of course, you're going to get binary information there. It's not going to be plain text and you need permissions because obviously if anyone could just read the raw data coming from your keyboard, that's called a key logger. But today we're actually going to be controlling the lights on your computer. Pretty much every computer has some form of LED, although they seem to be getting rid of them. Like I didn't know since I started recording this tutorial that my laptop doesn't have like a hard drive flashing light because you used to have that when your hard drive was working. It would flash. Of course, I guess nowadays we all have solid-state drives, but you still would think data transfer would flash. But my laptop does have LEDs on it. So let's go ahead and have a look at it. It is a ThinkPad. So let's go ahead and look at my ThinkPad here. And ThinkPads, at least the newer ones, Focus have the word ThinkPad right there. And the I is dotted with a red LED. Well, in our terminal, on our system here, I'm going to move into the sys folder. And if I list in here, you can see there's a folder called class. And if I list out what's in here, there is a folder called LEDs. We're going to move into that LEDs folder, list of what's in here. And they're pretty self-explanatory, although can be a little confusing at times. We'll go over that in a moment. But you'll notice that there's one here called, at the end of it anyway, the name of the folder is lid logo dot. So let's go ahead and move into that folder. And we will list out in here and you'll see one called brightness. Now some LEDs or lights on your computer may be able to have varying amounts. So you can fade them in and out. But for the most part, if I just echo, whoops, got a spell echo, right? Echo zero. And write that to the brightness file. You can see the LED turned off. If I echo one into there or anything other than zero, I bet if I put two, so if I do zero, it's off. If I do two, it's going to still be on. It's not any brighter than one is though in this particular case. So I can turn this off and I can turn it on and I can turn it off and I can turn it on. But there are other LEDs on my laptop. For example, if I open up the lid here and we look over at my power button here, right here, my power button has a white LED on it. Well, if I back out to my previous directory, the LEDs folder, you'll see that there is one labeled power here. So let's go ahead and move into that directory. And just like before, if I write zero to that brightness file, the LED is turned off. If I write one, it turns on, off, on, off, on. Let's go out of directory and you'll notice if I list out these files again, there is one for caps lock. But you notice I do have caps lock here for this input and the lock. That's because I got two keyboards. I got my laptop keyboard and then I got my other keyboard here. But we were going to go into input zero, which is going to be this keyboard for my computer. And I am going to go into the one for the caps lock. And if we come over here and look at caps lock, and just like before, into the brightness file, I can echo one to turn it on and I can echo zero to turn it off. On, off. Now let's look at me again. Hi. So those are some LEDs, but you'll notice on my microphone here, there's an LED. Okay. And it's flashing. Anytime my computer is accessing this LED, it flashes. So when it's plugged in, the light's blue. And even if I just open up something to monitor it, even if I'm not recording, that starts flashing. So I thought, can I control that? So if I go back to my terminal here and I look at my directory here, there is one in here that says mic mute, platform mic mute. So let's go into that directory and let's try to echo zero, see if the light turns off. Now it's kept flashing. Let's try turning it on, nothing off, nothing. That's because it's not this microphone. It took me a moment to figure this out. If I look back at my keyboard here and focus, there is a microphone mute button here. And that has a light on it. And that is what it's controlling. I also have, if I move back out into this directory, I have one for the just says mute. So if I move into there and do the same thing, it is actually the mute button on my keyboard here. So what's up with this one? I haven't found any files that seem to control this LED. So I'm assuming that this is being controlled within the microphone itself. So I may not be able to control that. It just depends on whether the device is controlling it internally or if the computer is controlling it. And as far as I can tell, I haven't found any LED files on my computer that control that. So let's have a look here. I feel like there was one more thing I wanted to go over. Oh, right. Yes. Something fun. So if we look back at my laptop's keyboard here and focus, I have a function button here. If I hit function and spacebar, it lights up my keyboard. And if I hit it again, it gets brighter. And I hit it a third time, it turns off. So let's go into the terminal here, back out into this directory. If I list, you can see one that says KBD backlight. So let's go ahead and move into that directory. And I can cat out this max brightness, which you would think would tell you the max brightness, which for this particular device it does, it says two. A lot of them will say 255, because there are devices that you can control them fading from zero to 255. All the LEDs I've shown you so far have said 255 is the max, but one seems to be the brightness, so I don't know what that means. But I can control the three, well, three settings on this. So I can cat out what brightness says and it tells me its current state if I haven't mentioned that already. So let's go ahead and we can echo into that one and my keyboard lights up a little bit and I can go two and it got a little brighter. So one, oh, did it get brighter? Two. Yeah, I thought it did. I tested this earlier. One, two, one. It's not showing up by saying I'm looking at the camera. I think that maybe the exposure on the camera is adjusting, but it definitely is changing. If I look at the keyboard with my own eyes, it's getting brighter and dimmer. And of course, zero will turn it off. So I can control the brightness of that to three different levels if you count off as a level. Now, I hope you found this useful. And I'm not just showing you to show you this, I actually read an article the other day about something that sounded pretty cool. So I kind of decided to implement myself. So we're going to have some funds, funds. We're going to have some fun with the LED on my laptop lid here in the next video. So I do thank you for watching. Please visit FilmsByChris.com. That's Chris the K. I also have a Patreon page. You can also support me through PayPal or LibrePay. If you go to FilmsByChris.com, there's a link in the description. There is a support section where you can see all that. If you can't support me financially, think about sharing, liking, subscribing, commenting. Thank you for watching. And as always, I hope that you have a great day.