 Hey everybody, welcome back to the channel. Today, we're gonna be talking about scratch pads. Now, scratch pads are not a window manager-specific thing. Like they exist in I3, they exist in DWM. There's a program that is window manager agnostic, agnostic called, oh hell, I don't remember what it's called, like T-flop or something, I don't know. I'll put the link to that in the description below so you know exactly what I'm talking about, because I can't remember the name. But when I first saw the term, I never didn't know what it hell was. I've been using I3 for months and months and months, almost a year, and I had no idea what a scratch pad was. I never used an I3. I mean, it was just, wasn't something I mean, I'd even come across. So when I first started doing my research on DWM, DWM, I came across the term scratch pad. I was like, what the hell is a scratch pad? I mean, I'm assuming that it's analogous to something like in the real world scratch pad, like something that you can doodle on or whatever. Excuse me. The burp totally made me lose my straight of thought. That was gross. Anyways. So I was like, what's a scratch pad? So I did a little bit of research and I realized that it's a terminal, basically, but a terminal that kind of exists on a workspace that doesn't exist or an invisible workspace, if you will. If you want to learn what a scratch pad is, and you're using DWM, there is a patch for it. So first I will show you what the patch is and I will do that on the main screen here and switch over to it so that you can actually see it and zoom in so you can actually see it. Okay, so the patch that I use to do this is DWM-scratchpads2020. This I'll show you in the browser as well. Actually, I can do that. Let's see here, DWM and patches and scratchpads. Okay, it was this one, I think. Yep, this one here. And again, I will put a link to the description in the description to this patch as well. So the question you have to ask is, what is a scratch pad and why is it useful? And I will put this right up front. Scratchpads have to be the most awesome things that I've ever discovered because, and I'm so disgruntled that I didn't know of these before. So a scratchpad, like I said, is a terminal that exists on an invisible workspace. So once you have this patch installed, you get three scratchpads. I'm not sure if you can create more. Maybe you can, probably you can, but I've not tried that. So don't quote me on it. But what you can do is do mod y and you get a scratchpad. Now this is just something I have open in this particular scratchpad. Normally it looks just like a regular terminal. This is the ST terminal. So you do have to have ST installed if you're using DWM. If you're using the generic scratchpad application that I'm listing below, you can use any terminal that's supported by that application. You can use Turma, you can use Alacrity, you can use ST. I'm assuming you can probably use things like Kitty or X-Term, I'm not sure. But this is what a scratchpad looks like. It's just a terminal. And it exists on a workspace that doesn't exist. So if I were to open up something in this, if I just do an LS of my home directory and I close this using mod y again, when I open it up, that's still there. And the reason why I think this is so damn cool is because I can go through and do this. I use NCSpot for Spotify. I can open up to NCSpot and this is here all the time. So I can just play a song, get rid of this. The song keeps playing and I wanna change to another song or change playlists. I just go into y again and I'm there. And y again, it goes away. That is amazing. And no longer, usually I would go through and have it on a workspace five. Usually a workspace five on the main monitor is my music workspace. Now my workspace doesn't have to be taken up with NCSpot because it exists in a terminal, you know, in a scratch pad. That is amazing. So let me show you what the code of scratch pad looks like. So let's CD into my config.h or them into my config.h here. And let's just scroll down just a little bit. So the first thing when you do a patch adds these, what were the seven lines or so? I guess it adds the structure here as well. But basically what this does is it defines three scratch pads. And these are the things that will tell you it spawns the ST terminal with the flag N, which basically just gives it a name. And dash G, which gives it a size. And then the last argument can either be null or you can do another flag and run a specific program. So if I do mod U that opens up the ranger file manager. And you can do pretty much any terminal application you want by just just by following this syntax, you know, get size and then the E and then the name of the program and then it always ends in null. And you can change the size of the terminal as well just by using, you know, you know, length by width. And that's the definition of the three, those are the variables of the three scratch pads. And then it names them for something specific. And these are the something specific. It translates these of them into a command which they can be used in a key binding. So it takes the name from up here, puts it here and then names it this specific command. Okay, I'm assuming you can go through and make as many scratch pads as you wanted to. I don't know why you'd want a whole bunch of them. Three seems to be about enough for me. But you could probably create like five or something and then bind them to whatever you want. So, and then the only other thing that it adds, and this is probably something that will fail when you do the patch. If you do the patch and it fails, it's probably because the, you've probably added different key bindings to your config file, which will change the line numbers. And for me, I had to go through and add these three lines here manually. And this just defines key bindings, why you would end to those commands that were associated to the scratch pads that we defined above. And that's literally all the patch does to the main config file. I'm assuming it adds something to DWM.C. I'm not sure. I didn't actually look because it went through perfectly fine. But that's basically what scratch pads are. And like I said, I love scratch pads now. I mean, I just been playing around with them for now for about an hour. And these, I can see this completely changing the way I do things on DWM, mainly because I no longer have to keep a like oftentimes I'd be working around in my browser and I'd have to have this in monocle mode so that I could also have your Ranger open. And then I'd have to switch back and forth between them like this, you know, I no longer have to do that. I can keep myself in tile mode or whatever layout I'm in. And I can just do mod you and I have Ranger there at my fingertips, wherever I want. That's awesome. I mean, that's just completely blows my mind. And I'm gonna be adding scratch pads to every window manager that I switch between. So I'm gonna go figure out how to do it in I3. I might make a video on that just because it's so cool. So, yeah, I'm just, I'm giddy. I learned something new. I also had sugar before I did this video. So that's why I'm a little hyper. But this is cool. It's just so cool. It's just a short little video. Scratch pads are awesome. And, you know, really this is just a, you know, it's just a terminal. So you could have any, you could have your I3 config, I mean, say you're in I3, you could have your I3 config, you know, open. If you use that all the time, you could have something like be pi top open all the time. And it's just always there. So you get that. It's just always, you always want to just, you'll look at your system stats. It's always right there. Just easy as can be. That is so cool. So cool. Anyways, just a quick, just a quick video showing my new obsession. If you want to support the channel, you can do so by leaving a thumbs up or a thumbs down even. You can do, you can subscribe or you can support monetarily by going to patreon.com slash the Linux cast. And you can also follow us on Facebook at facebook.com slash the Linux cast. I don't really use Facebook, but every once in a while, you'll find me posting something on there. So yeah, thanks for watching. Just real quick video and I'll see you next time. Thanks for watching.