 So in the video that I made a couple days ago about my i3 workflow One of the things that I said that I was missing was the ability to do scratch pads now Now i3 does have its own built-in scratch pad mechanism And if all you ever need is one window as a scratch pad like a terminal or something it works fine It's okay It's never gonna be as good as the scratch pad patch that is in DWM But it works fine as long as you only need that one scratch pad and the reason why it's not really Great for me is because I need more than one scratch pad. I usually have two terminals. I have one for Pulse mixer I have one for Ranger and so on and so forth the built-in functionality for scratch pads and i3 just doesn't really handle multiple scratch pads all that well now you can go through and Configure it so it works a little bit better with rules and such but it's still it's not great Like if you go through and have multiple scratch pads open at one time sometimes you have to cycle through them and If you've have gone through and made rules for them Sometimes they show up. Sometimes they don't show up. It's not a great experience Like I said, it's fine as long as you only have one scratch pad It's when you start adding more than one scratch pad that things get messy So for a while that situation was one of the real downsides to my enjoyment of i3 over the last few weeks But after I posted that video Someone in the comments, and I'm sorry. I don't remember your name pointed me towards a YouTube channel And that YouTube channel is called Bud Labs now Bud Labs is a very small channel and I gotta tell you this right now I've only had a chance to watch a couple other videos Really good like really really good if you're into i3 go watch this guy use i3 He knows I learned more in the two videos. I watched about i3 that I have pretty much in any other video They're really good I will link to his channel and the videos that I enjoyed in the video description below But the point is that he has a script called i3 run now what i3 run does is it solves the scratch pad issue on i3 So that's what I'm gonna be talking about today So the first thing we need to do is Install i3 run in order to do that you can use the aor or you can build it yourself really all this is is a bash script and There are several other bash scripts that this youtuber has created I haven't used those but I have used i3 run but if you are on Arch Linux you can actually install this by using an aor helper and searching for i3 ASS You search for that it's an aor you'd install it just so you would a normal package from the aor you can use Yeah, your par rule whatever you want to do that will download all the scripts including i3 run It's not a big deal It's just going to take them put them in your path and then you can run them as you would a normal script Now I already have this installed so I'm not going to install it But the next thing I should show you is the GitHub page for i3 run now basically this is shows you all you need to know about how to run it I'm going to change my webcam to the other side so that you can actually see this so basically these are the Actions that i3 run will do if it's active it will send it to scratch pad if it's hidden It'll show the container if it's not if it's not in current workspace It will go to the workspace and focus the window if it's not active not hidden or on workspace It'll focus the window and if it's not found it will execute a command now Basically that last one just means that if the scratch pad doesn't exist it'll actually just start it So you'll have to know some certain things about the application in order to get that command to run And I'll show you that here in a minute Now there are several different ways you can do this and basically you need to know these things about the window You don't need to know them all you just need to know one of them now The developer says that you should not use the dash dash title flag because titles window titles change. That's true I have used it a couple times it has worked fine, but it can be kind of hit or miss So you may need to know the class name class name is probably the best thing for you because that doesn't change That's card coded by the developer of whatever application you're trying to use as a scratch pad So let me show you how this works. Let's go back to a terminal now just in practice I have several scratch pads set up so I have a scratch pad for Pulse mixer, which is super B and that brings a pulse mixer in a scratch pad just like you'd expect now by default This is not going to be floating. That's something that I had to do and I'll show you that in just a minute So if I could go ahead and hit super B again, it goes away Now I also have a terminal scratch pad bound to super M so I open up that and I can open up H top here and We have H top running it goes away comes back each top is still there. That's what a scratch pad is and That's the simplest use of a scratch pad You can go through and just use a terminal for whatever you want to do and this terminal will do everything a normal terminal We do because it's just a lacquerty now I can get out of that and go and remove that scratch pad. It's gone now I also have one for ranger right here and I have one for NC MCPP or whatever hell it's called right there. So those are my scratch pads and that's exactly the functionality I had in DWM that I was missing so much in I3. So how does this work? So if you go into your I3 configuration file, so cd.config I3 and then into config So basically what you would do is go through and set up a key binding that would run I3 every time You execute that key binding now You'll notice that I don't actually have that in my configuration file That's because I don't use the I3 configuration file for my key bindings instead. I use sxHKD So I'm going to open up in a vertical split here my sxHKD RC file and then if we go down here right here, these are the key bindings that I have set So basically how this works it calls I3 run which is again is just a script and it Tells it that the title that it should be looking for is pulse window Which is just something that I created it you can name it whatever you want and then what it does next Is it you do two dashes and then the name of the application you want to run or the command you want to do if The scratchpad doesn't exist. So if you got rid of this and the pulse window didn't exactly actually exist Nothing would happen. You actually have to have that command in order for it to create it if it doesn't exist So basically all this does is it calls a lacquery gives it the title of pulse window and then opens up pulse mixer That's all it does and then if I hit super B Brings up brings up pulse mixer now in my I3 configuration file What I did was right here. I created a rule. So for title pulse mixer make it floating That's all it did by default if you didn't have this rule it would be in tiled mode So you can kind of make that decision and what you want tiled once you what you want to be floating Whatever you want now. I've done the same thing for my terminal scratch pad. I do I3 run it's going to look again for a title called TTRM and The command is a lacquerty dash dash title TTRM. That's all it does now The one place where I had a problem was with Ranger because oftentimes I have Ranger opened up on just a regular workspace I'm using it for something or the other but I I still want to have it as a scratch pad So I can do something like that thing is that won't work if you use the title because they both have the window title ranger and that's even more confusing if I have a Document open that I opened up through Ranger into Vim that actually a lot of times still has the title of Ranger even though I'm in Vim it got really confusing so That's the reason why you really shouldn't use the title instead You should use the class and one of the great things about Alacrity is that you can actually define the class name and that's what I've done here So I've done Alacrity dash dash class and then gave both the class names of FM and then executed Ranger if It didn't exist in the first place. So that is what I3 Run basically does now Let's just say you have a scratch pad open So I have Ranger open and then I navigate to The first workspace if I go through and actually do the same key binding for Ranger that I just did Which is super see it's actually going to change the workspace to that last workspace We were just on so I go super see it takes me back to workspace 3 so that in that way It actually is a little bit different than that's the patch in WM in that in DWM If I had the scratch pad open up and then I navigated away from it It actually just go back to the scratch pad workspace and then I could call it back again on the Another workspace if I wanted to it doesn't actually change focus of the workspace Whereas this if I go to another workspace So let's just say 7 like I'm on workspace 7 now And then I do the key binding to bring up the Ranger scratch pad instead of bringing it up on workspace 7 and actually takes me back To workspace 3 so that's a little bit different, but I don't find that bad at all I can still go through and hide it go to 7 and bring it back up on 7 if I wanted to it Probably will take me a little bit getting used to but I always hide my scratch pads after I'm done with them Anyway, so I'm just used to you know I'm here doing whatever I need to do and then I close it and then I go back to doing whatever I was doing before That's the route route the way most people I think use scratch pads. So that is I3 run There's not a lot to it now Like I said, there are other scripts that come in that I3 ASS Package that you download from the EUR or that you build on your own I haven't played around with any of those so I don't know exactly what they do I will say that the developer who did I3 run seems to be very clever and has solved some problems that you may have with I3 so I highly recommend going through and giving those a try and also Subscribing to his youtuber channel because he has several videos on those scripts So honestly this solved a major problem for me because like I said the built-in scratch pad functionality For I3 is not very good, especially if you again if you have more than one scratch pad This has solved that like it's it's just fantastic like I'm happy again So thank you to the developer who has gone through and done this for Everybody and then shared it to the world because this is the kind of stuff that just kind of makes me happy that Linux exists So that's it for this video if you have questions about any of this stuff You can leave those in the comment section below make sure you like and subscribe I really do appreciate everybody who has already done that. We just went over 9,000 subscribers, which is just Mind-blowing. I mean just just seriously. Thanks everybody who has subscribed and if you haven't already hit that red button We're creeping up on 10,000 already. So this is thanks everybody who's done that So you can follow me on Twitter at Lenox cash You can support me on patreon at patreon.com slash linux cast before I go I'd like to take a moment to thank my current patrons today Devon Patrick on Marcus Meglin Jackson F and tool Steve a separate your Lenox Gary Mitchell our center carbon data Jeremy Shawn Odin Martin E Andy Merrick Cam Dr. Lee J dog Peter a crucible dark vans six flat a primus. Thanks everybody for watching. I'll see you next time