 Hey everybody, welcome back to the channel. Today I'm going to be doing a quick comparison of i3 and DWM. Now, really, these two window managers have very little in common other than they're both tiling window managers. Outside of that, they're both coded differently. They're both built differently. They're both, you know, compiled differently. They're both, you know, have different features out of the box and they both tiled differently. So they don't have a lot of things in common, but you might be trying to decide between them because you've gone to Unix porn, you've seen many, many, many, many, many, many, many i3, you know, rice is out there and they're all awesome, you know, to varying degrees. Some of them are, you know, more awesome than others. And you've probably seen a DWM rice here or there, or you've watched a video of somebody using DWM or using i3 and you're like, that's really cool. I want to try them, but I don't know which one to choose. And that's what I thought I'd talk about today. So we're going to start with i3. Now this is i3. This is not what i3 looks like out of the box. This is my personal rice of i3 out of the box, you'll get a black screen and a black bar along the bottom. That's all you'll get. As long as you've installed all the dependencies, it's possible that if you haven't installed all the dependencies, you won't even get a bar. But let's just say you've obviously installed it correctly. And you have a black screen and a bar. This is something that you could do fairly easily. This is poly bar. This is just a wallpaper set with nitrogen. It's very easy. Now, my configuration is quite different than what you'd see out of the box. Out of the box, you're going to see a configuration file that's probably about 200 to 250 lines long. If you've started with a i3 that comes from Oracle Linux, you'll probably see when it's about 1000 lines long because it has tons and tons of stuff in there. Mine is 100 lines long. And really, I could get rid of this last line and go back to 97 98 lines long. I don't really need that syntax highlighting because it doesn't actually work. But mine is different because it has hardly any of the key bindings located inside it. It's all my key bindings are in a program called sxhkd. And that's unusual for i3 sxhkd actually is a thing that you use with BSPWM, not i3. But this is just the way I've set it up. But for i3 itself, you'll have a configuration file that's like said around 250 lines long. And it will have you'll probably start off something like set mod for as the mod key. And it may have a few, a few lines of code that will define where your monitors are and where the workspaces are supposed to go. The default one probably doesn't have that but it will list the amount of workspaces you'll have you probably start off with 10. I have 19 because I need as many as possible. And then I'll have a few modes and stuff. So modes are something that I'll talk about here in a few minutes. Now, the first thing you need to know about i3 is that it's a manual Tyler. And basically what that means is that you get to decide when and obviously you get to decide when but you get to decide where the next window pops up when it's spawned. So by default, this is how windows are spawned. They'll just keep going to infinity and beyond in that direction until you've changed it. So we just quit those because that's way too many terminals and you know whatever. But let's say I wanted to spawn a window somewhere else. So in this case, I want to spawn it below this active window on the right hand side. I can press a key binding and press enter. And we'll get a window in a different position. And I can go back to a different key binding in this case control H. And I get to decide where that next window is spawned. This is called a manual Tyler. And it's one of the key differences between i3 and DWM. And DWM as I'll show you in a few minutes, you'll see that DWM chooses where the next window is spawned all the time. Now DWM has different layouts and stuff. So you can kind of choose where stuff is spawned. But it's always a set tree. Whereas with a manual Tyler like i3, you're always in control of where your windows spawn. And it's always controlled with a key binding. So we'll just close that out. The last thing I really want to talk about is the way that it's configured. So if we just look at this configuration file, you'll see that this is not a known programming language. This is just usually what we consider this is a user safe syntax. Basically, what that means is that it's written in such a way that it's user friendly. So it works. I mean, you can read this and pretty much know what it's doing. So it's set right here is setting a variable first monitor and it's setting it as display port one so that it and set second monitor and the HDMI one. So then this calls the variables that it just set. So it's very in some ways it's bash like but it's not it's even more friendly than bash because it's just workspace one output first monitor. It's literally user friendly. So when we look at the DWM one later, you'll notice a lot of differences because DWM is coded in C. And the configuration file is done in C, whereas i3 is written in whatever it's written in, I don't know. And it's probably Python. I mean, everything's written in Python, right? But it doesn't really matter. The configuration file is not written in the same language that it's coded it that i3 is coded as so that's a one of another key difference. Now, I wanted to take a moment before I leave i3 and talk about modes, because modes is something that DWM does not have. And it's actually I'm pretty sure modes is basically unique to i3. I don't can't think of another at least popular window manager that also has modes. I'm trying to think of one I don't think that there is one but I could be wrong if if you know one you can leave it in the comments below. But basically what modes are is it adds an extra layer to your key binding system to control certain actions of the window manager. So it's kind of like if you're in emacs, or if you're in Q tile, you could set a key cord. So you could do like control V. And then you could do another key binding after that in order to prompt an action. One of the modes I have on my system. And actually, I think it's the only mode that I have on this system active is the the restart mode. So if I hit mod X, I get this little thing up here that allows me to lock, log out, suspend or hibernate or reboot or set down my system. In stock i3, there are several others. So you could do mod R in stock i3. And that would enter resize mode and that would allow you to resize your windows. Now, because I don't actually care for the mode system all that much, I've just set up a key binding that allows me to change the the size of the windows like that instead of having to enter a mode. But modes, you can pretty much create a mode for anything if you want. And like I said, they're kind of like key cords that allow you to take one key binding and then map other key bindings inside that mode to certain tasks. So you could have a key binding like SuperD is usually or SuperD is usually something like D menu. In my case, Rofi. And, and that's a normal mode. If you entered a mode, you could also have SuperD bound to something different like, I don't know, changing the window size or whatever it doesn't matter. Because you're in that mode, the key binding work is different than what it would be in normal mode. Alright, so that is i3 just really quick. Let's go ahead and move on to DWM. Okay, so this is DWM. Now, this is not what DWM looks like out of the box by default, you'll probably get, you know, a series of numbers one through nine here, and you'll get you know, a blue bar here, when you have a window, when you have a window open, I have green, and you probably won't have anything up here other than the version number of DWM. So let's go ahead and start with what's different with DWM compared to i3. Now, as we talked about, i3 is a manual Tyler and basically, like I said, that means you get to choose which and where your windows show up with DWM. That's different because you'll always have windows appearing like this. Now, DWM does have other layouts, but they're always in a tree mode. So in this particular configuration, you have a main window, and you have several child windows. Okay, and this is called the master stack layout. And I could change this to a monocle out and basically, a monocle out is where all the windows are layered on top of each other and you navigate through them using your super key and your BEM keys. Another one is a floating layout. This comes with DWM by default. And that allows you to go through and have a window that's floating. And then I can just change back to a different, you know, layout with a key binding. Now I have several other layouts installed on my system. So I can go through and go to use a this is the Fibonacci layout. Basically, that just means all the windows are going to keep getting smaller and smaller and smaller and like a rotating spiral. I have this layout here, which is basically monocle out, but it has the main window over here, which is just a single window. And then all the other windows are over here and you navigate through them with the BEM keys. And then I have another one here. This is this one, and then this one, and this one, and this one, and this one, and this one, and this one. These do not come with DWM out of the box. In order to use these, you have to patch the system. And I'll talk about patches here in a few minutes. Let's go ahead and close some of these windows here. And we'll just leave it like this. So that's the primary visual difference you'll see in DWM. It controls tiling in a completely different way. Now, the other big difference is how DWM is configured. Now, like we talked about with i3, the code that it's configured in the configuration, the code that the configuration file is written in is a user friendly syntax, right? It's very readable, something that even a new person could you could read that code. And you pretty much would know what it's doing with DWM. It's not that way. So let me show you my DWM file. So let's CD into that config. Now, your configuration file might be somewhere different is wherever you've chosen to compile your DWM folder. I've just done it in a suckless file because I have a whole bunch of other suckless programs installed. So if we do an LS, we'll see a whole bunch of files here. And if the one we're looking for is config.h. Now, if you've installed DWM, I'd recommend always doing all of your changes in config.dev.h and then deleting this one before you compile. Because then you've gone through and made changes to the base system. If you've got if later on you've made changes to just config.h and then you patch something, you'll lose all the changes you've made in config.h when you have to delete that in order to get your patches to work. So always make your changes in config.h. So I'm going to just go into them into config.dev.h. And this is what let's close these we can actually see these and we can zoom in here. So you can actually see this is what the configuration for DWM looks like. And right away, you can see that this is completely different. This is the C language. If you've tried to compile this and you've missed a semicolon or an equal sign somewhere, you're going to find an error and it's not going to work. It's not going to build. And that's the biggest really the is the biggest difference between I3 and DWM is that you compile this code every time you make a change. So if I change a color down here, I could change you know change this color here if I wanted to. I'm not going to because I don't want you know have to go through and redo it but you change a color you save this and then you have to go through and run make and then you have to do pseudo make oops install and enter your password and it will go through and make these files you know in the way that it does. And you have to do that every time you've made a change and even more once you've done that you have to log out and log back in in order to see those changes take effect. Now there are ways you can get around that by you know either with a patch or with something with your excellent RC file. But for the most part if you want to see your changes you have to log out and log back in. And that's you know completely different than our three whereas you know and I three when you make a change you make a change in configuration file you save it and then you hit my shift R and it reloads I three live right there in front of you now like I said you can you can emulate that behavior in DWM. It's not something that comes to you out of the box and that kind of leads us to patches. So if we do another LS here we'll see I have a patches directory. Now this is not something that you will have out of the box. If I can actually you know type this is something that I've added. And if we do an LS here you'll see that I actually have see an LS so we can actually see it. I have like eight well like 11 patches here that I've you know installed in DWM and you can have this many or you can have many more but the more you've added the more you know problems you're going into having and basically what a patch is is exactly what it sounds like it's a snippet of code that you download and you place into the DWM configuration or source code in order to add functionality. Now with I three when you've downloaded that you get pretty much all the functionality you'll ever going to get with I three that has everything built right into it. You want scratch pads. It has a scratch pad functionality. You don't have to do anything to it other than add the scratch pad code to your key bindings with DWM. It's meant to be as minimal as possible or mostly minimal as possible. It comes with the bar but whatever it's meant to be as minimal as possible. So you actually have to go through and add those kind of functionality to that kind of functionality to it. So for example I wanted a scratch pad which is basically a floating terminal or floating application. I have to add this patch here. So if I've been into that DWM scratch pads basically what you're doing you're getting a description of the patch which is mostly unusual because usually they don't have that big of a description. It's telling you what files that it's editing. So two files change and has 65 insertions. So these are the things that it's going to add to the code. So it's going to add to config.def.h is going to add all this stuff with the plus to it. Okay. And it's and it even shows you where it's adding it to. So it's adding in between this line here that because you'll find this line in your config.h file and it's then it will add this stuff and it's adding it before the tagging system. That's how patches work. Now you don't do this manually. Okay. So if we do if we go up a level here and do an LS let's just say I wanted to patch in this here. I do patch and then dash P1 and then this symbol and then you know do the DWM hide whatever. Actually I'm pretty sure that's supposed to be P1 not P2 Matt. You could also just use patch. There are a couple of different ways of doing this and I might have that symbol turned around. I can't I can't remember. I can never remember. I would every time I have to patch something I always have to look it up. But the point is is that this term patch will actually go through and do this automatically for you. And for the most part it works with few patches. The more patches you have the more likely is your patches going to fail and then you have to go through and do it manually. And that would mean going through and copying pasting out of these files here into the configuration files that it determines in the patch itself. So if that sounds like a lot for you if that sounds like a lot of crazy things to have to do it is and it's not something that's going to be for everybody. Really the the patching system is where a lot of the hardness of DWM comes in because you're going to get a lot of errors the more patches you add. So as a new user DWM is probably not a great idea. And like I said at the beginning use i3 for a little while and then move to DWM. That's the best way to go or use something like BSPWM. With DWM you're looking at getting more invested in actually learning a programming language. So with DWM you have to know some cplay. You're going to learn that inevitably by using it now. I came into this not knowing anything about this and I've learned some stuff. I don't know why I've learned it. I don't know the reason why I have to use a semicolon at the end of the line other than I know that I do. I don't know why things are defined in those ways. I can read the code fairly well. It's not as unreadable as something like Haskell or even I was using awesome earlier today and Lua is kind of unreadable. It has some really weird syntax in Lua that you have to deal with. Commas don't always go in the same spot in Lua for some reason. I don't know. I mean I just spent a couple hours looking at it this morning and they don't always go in the same spot. With C++ it's usually fairly predictable but again it's something that you'll have to learn and something that you'll have to pick up over time if you don't know what going in. So basically those are the basics of I3 and DWM. Now I could spend hours and hours and hours on each of these window managers just going through the small niddley you know nitpicky details but just briefly which one should you use. For me I prefer DWM for most the most part. There are things that from I3 that I miss so I miss the ability to assign each workspace key binding. So as you saw in my I3 configuration file I have 19 workspaces and in in my SXHKD file which is where I control my key bindings in I3 I have key bindings associated with each every one of those workspaces so I hit super 1 through 0 and I can access workspaces 1 through 10. I hit control 1 through 9 I can get through to my workspaces 11 through 19. In DWM I can't do that now there is a patch to do that I know that there is but I've used so many different patches I don't want to add another patch because I know it's going to fail and even if I go through and add it manually it changes our in might not work plus it adds extra lines of code and it's it's can get messy so there are like I said there are things I miss in I3 but I prefer DWM's layouts and I prefer always not having to always choose where my my window is going to show up so I prefer the dynamic tiling window management system it's why I prefer Qtile and stuff like that but for you it's really going to depend on how willing you are to learn a language so if you're willing to learn some C++ and and actually figure things out in terms of you know where semicolons go and you know how the patching system works then DWM is probably really good for you if you're really really new and you're not interested in taking that jump yet I3 is definitely the better one to go now if you're a longtime user of tiling window managers and for some reason you haven't used either one of these they'll both do you well really well if you've used something like Qtile or if you've used Xmoment Xmoment add you'll probably be more comfortable in DWM if you view something like BSPWM you'll probably be more comfortable in I3 because they're much more similar now BSPWM is a little more complicated and has some weird things you do to assign where the window goes and stuff like that I don't know a lot about BSPWM but they're both well those are both manual tileers so they're both similar in that way they're also both coded and user-friendly syntax one's written in bash one is written in whatever I3 is written in so my best advice is to try both I have a video where you can install DWM on Ubuntu so I will link that in the video description below and in the probably in the cards above so you can check that out if you don't know how to install DWM that's pretty much the same on every system so you could probably watch that even if you're on Arch or Fedora or whatever Gen2 is going to be a little bit different because you got to merge and all that kind of stuff I don't know how Gen2 works at all I've never used Gen2 before maybe that's something I should do anyways thanks for watching you can follow us on Twitter at the Linux cache you can follow us on Facebook at the Linux cache you can support us on Patreon at patreon.com slash linuxcast and with that in mind I would like to take a moment to thank our sponsors or our patrons Devon they're basically sponsors you guys are sponsors patrons Devon Zach Marcus American Camp thank you for your support thank you for watching I'll see you next time