 So if you've been following the channel for any amount of time, you'll know that I talk about window managers and scratch pads and workspaces and File managers quite a lot on the channel. I'm quite a nerd really And honestly, I don't think there's anything wrong with that I talk about the things that I'm interested in and it just happened to be a nerd So today what I'm going to talk about is scratch pads now I've talked about scratch pads like I said several times on the channel the last time being Video I made about a program called i3 run now That was a little script created by youtuber and it was really interesting It did scratch pads what I consider the right way it spawned The scratch pads when you hit the key binding and you could hide it just like you would normally and it would come back And with the same key binding it was really good The problem is is that the developer About two weeks after that changed the dependencies from being able to work with both i3 and i3 gaps to just working with i3 now This is the perils of using a script that's written by someone else And I was told at the time by Jake at Linux that it was a bad idea And he showed how to do scratch pads the proper way using the built-in Mechanism the i3 has and I was like it's gonna be fine. It's gonna be alright. You know, there's no problems here It's you know, this script is gonna be around forever. It's amazing And it's definitely does things the way I want to be done and it's gonna be it's just gonna be it's it's fine It wasn't fine that was like two weeks after that. Like I said the scripts changed to where it won't work with i3 gaps anymore So I was out of luck. So what I ended up doing was just using the built-in mechanism for Scratch pads on i3 and that's what I'm gonna show you today How to use scratch pads on i3 now the point in this video is to maybe provide some insight into how scratch pads work on i3 I'm not going to get into a whole philosophical argument about if you should use scratch pads at all Some people use the crap out of scratch pads. I'm one of those people some people They don't see the point. That's why they have workspaces me like both So I'm like let's have some both because frankly I can never have enough workspaces So having an invisible one that just kind of goes away and's not there and You call stuff from it when you need it. That's just it's like christmas is there for me whenever I want it to so Let's just go ahead and jump right into how to use scratch pads on i3 So the first thing we should do is I should actually show you a scratch pad Maybe you don't know what a scratch pad actually is you've never seen in my previous videos before And let me just tell you you're missing out. So basically what a scratch pad is is a Hidden window on a hidden workspace meaning that it doesn't appear ever appear in your bar So they call it the hidden workspace whatever some window managers have a specific name for it But I call it hidden workspace and when you hit a key binding and it could be any key binding you set To any program that you set it will bring up a window So in this case it brings up a terminal and I can hit the same works The same key binding and it goes away And I also have one for pulse mixer. I have one for ranger. I have one for ncmpcpp or whatever hell that's called Those are the scratch pads that I have and they're Kind of amazing. I also have one for neomut, but I don't have neomut running right now But the point is is that if you wanted to have say like an update running if I just wanted to do an update here I could just run my update command hit enter. It would run in the background It doesn't take up a workspace If I wanted to have my my music player playing around in the background I could do that. It doesn't take up a workspace and not only that but it's available on any workspace I hit the key binding on so if I'm on sit right now. I'm on workspace four. I can go to five Do the same thing It's there right and the same thing on my other monitor if I go over to the monitor You may be able to see this but I could hit the same workspace And it would show up on that workspace. That's what makes scratch pads so cool So let's go ahead and go back to four here now This is my i3 configuration file It is not as short as I'd like to be because I have some key binding in here that I haven't been able to move over to sxhkd yet, but someday I will figure that out how to figure out how to do that But the point is is that this these key bindings right here starting With line 13 all the way down here are the beginnings of what you'll need in order to use scratch pads and i3 So these are the key bindings that are going to correlate with the programs that you want to open up In a scratch pad. So you just do the traditional way of setting a key binding So in this case it's bind sim and in this case mod plus b And then what you're going to want to do is tell i3 What program you want to use and you do this by either using a class or a title now You should almost always use a class because the class is going to stay the same all the time titles sometimes change So for example, if I open up that scratch pad and open up b top Here you can see up there at the top in my bar I don't know if you can see this up here where the mouse is see where it says b top that's basically the class And that's not actually the class of this terminal the terminal is ttrm is that's the class but Because I've opened up an application and that kind of takes over the title I think I called this the class. This is basically that up. There's the title not the class my bad Misspoke the point is is that the title changes the class doesn't if that makes sense. All right Anyways, so once you've set the key binding and then tell the class now Let's just say you wanted to find out what the class is so you open up a terminal You can do this now as long as you're running x or you can do this if you're running wailand It's going to be different for you. I don't know how to do it. I'm sure there's a way But you'll have to look that up. So if you're on an x or based desktop environment or window manager, whatever You can do x prop. That's the command hit enter and then you click on the window You want to know the class of so you click on that and it will tell you what class what the class name is Is wm class string and in this case case there are two classes. It's I think it's called they're b and g A and g I don't remember which one is which or what the actual letter but there is two of them Sometimes you'll see in a program where one of them has a small smaller case letter One of them has a little case letter in this case You want the one with a little case letter and in this case alakar is exactly the same It doesn't really matter The point is is that you'll need the name of the class in order to do this So that's how you find a class once you've done this class equals Whatever then the next thing is how you're going to tell i3 that this is going to be a scratch pad So in this case you're going to tell to show the scratch pad and then move it to the position of center So by default this does absolutely nothing without something else So that's the thing that really bothered me about i3 and it really kind of continues to bother me But the point is is that you can't do anything with just a key buying So if I have let's show them I have this open Right and the reason why this is open is because I actually have a line down here This one right here line 21 this basically whenever I start up i3 it will start up an alacrity with the class TTRM which correlates with this key binding if this line went away and it didn't start up An alacrity with a class TTRM at the beginning of my session I could hit mod n all day long and nothing would happen because it's not actually running this Key binding here does nothing it it does not start the scratch pad You have to have a corresponding line to start up whatever scratch pad You are expecting to use anytime you want to use your system. So you have to have these lines down here So these are my scratch pads. I have exec dash dash no startup ID that just prevents things from spinning and then the name of The application now this can be any application that you want So let's just say you had a you wanted to do bit warren something you could do exec dash dash no Start up dash id and then bit warden that would work fine bit warden is the class and you would just then create a key binding for This it would look like something like this. It would look like bind sim dollar sign if you can type mod plus Whatever in this case, we'll just use id. It doesn't matter because I'm not gonna save this and then you do class in brackets equals quotation marks bit warden and then you do scratch pad show and then Semi colon move position Center and I just make sure that when you open up the scratch pad, it's mag dab in the center Otherwise, I think it will show up in the upper left hand corner, which would be annoying You want it kind of in the center? So and that's it all that's all you have to do in order to use scratch pads on i3 It can be any application It can be anything it can be any terminal that you want a lot of terminals have the ability to set specific classes So like oh acrid does like I do here dash dash class and then the the two class names So whether it's a and g or b and g add whatever those letters are I don't ever remember The point is is that you give it to so class comma class And then if you want to open up a terminal based application You do dash e and then the name of the application that you're going to be running every time that spawns Most terminals have a way of doing that the only thing that will change probably will be the flag Some of them use a different flag for this functionality Some of them if they don't have it at all They definitely will have a way to set the title in which case you would just go up here to Whatever scratch pads you were creating change the word class to title and that should work just as well But just keep in mind again That sometimes those titles change you don't want to use A title on a scratch pad that you know is going to change all the time for Example just a regular terminal because then when you press the key binding and it comes up It will look for a window that has that title And if that title doesn't exist anymore Your scratch pad doesn't show in which case it's just kind of lost forever until that title comes back So you want to make sure that if you do use title it was for something that's always going to be titled that thing Uh, you don't want it to be dynamic in that case. So let me talk a few minutes about the downsides of this So one of the reasons why I like that i3 run program so much is because when I typed in a Key binding to get to the scratch pad if the the scratch pad wasn't running already It would actually Execute it. It would bring it up and just start it up. So I never had to have those extra lines there at the bottom Here at the bottom where I execute the scratch pad every time i3 starts up I never had to have that because it would just Open them up, right? And the thing the bad part about this is that if we go back here And I have this terminal. So if I just quit out of this, this is just the terminal scratch pad that I have I only ever really need one so I don't need more than that if I hit Meta q or super q and quit that it's gone. I can go back to hitting Super n all the time It's not coming back until I actually restart my computer and even restarting i3 like this doesn't actually work Now I think I could probably fix that by doing this if I do exec underscore always And write that and then restart it. I think then I would get that back. Yeah, but I think the problem with that solution is if I restart again I'm gonna end up with two of them. I think no, maybe I'm wrong Oh, yeah, no, there's two of them there. That's the reason why you don't exec underscore always So that means every time you restart at i3 you would get just more and more scratch pads called ttrfm or ttrm whatever it's called And you just would keep stacking them up The only way that would work is if that quit Any previous instances of that first and then you know executed it or you can just you know, quit it manually Like that like there But the point is is that if something is closed like you've closed the terminal you closed whatever the scratch pad is There's no way an easy way of getting it back unless you have some kind of script that you write in order to kind of fix that I'm using this way despite the fact that there was at one time a better way of doing this So I'm not quite happy with this, but I'm at least happy enough where I haven't abandoned i3 So scratch pads are one of those things that I have to have so If I use a window manager that doesn't have scratch pad functionality, I tend to leave it very fast So the fact that this at least has it and it's good enough Makes me happy So if you have questions about scratch pads, you can leave those in the comment section below You can follow me on twitter at the linux cast You can support me on patreon at patreon.com slash linux cast Thanks to my current patrons robert sid devon patrick fred kramer Megalyn jexon at the tool steve separate linux character samuel kb tgb Mitchell j dog carbon dated jeremy shawn odin martin Andy ross edwardo Merrick camp josh holy peter a crucible dark benefit's primus and p.m Thanks everybody for watching. I'll see you next time