i3 Versus DWM - Which One is Better for New Users?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
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're they both tile 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 race 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 uh my personal rights 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 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 arco linux you'll probably see one that's about a thousand lines long because it's 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 or 98 lines long i don't really need that syntax highlighting because it doesn't actually work but mine's different because it has hardly any of the key bindings located inside it's all my key bindings are in a program called sxhkd and that's unusual for i3 s6 hkd 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 it'll probably start off something like set mod 4 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'll list the amount of workspaces you'll have you'll 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 tiler and basically what that means is that you get to decide when and or obviously you decide when but you get to decide where the next window pops up when it's spawned so by default this is how windows respond 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 you know 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 keybinding in this case control h and i get to decide where that next window is spawned this is called a manual tiler and it's one of the key differences between i3 and dwm in ewm 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 tiler like i3 you're always in control of where your windows spawn and it's always controlled with the 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 displayport one so that it in 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 uh 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 what it doesn't really matter the configuration file is not written in the same language that it's coded at the i3 is coded as so that's a one 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 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 keybinding system to control certain actions of the the window manager so it's kind of like if you were in emacs or if you're in uh q tile you could set a a key chord 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 block log out suspend or hibernate or reboot or shut 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 like i said they're kind of like key chords 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 a key binding like super d is usually or yeah super d is usually something like d menu in my case it's rophi and and that's normal mode if you entered a mode you could also have super d bound to something different like uh 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 all right 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 tiler and basically like i said that means you get to choose which and where your windows show up with dwm [Music] 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 layout and basically a monocle layout is where all the windows are layered on top of each other and you navigate through them using your your super key and your vim 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 keybinding now i have several other layouts installed on my system so i could 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 the monocle layout 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 vim 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 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 the config 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 dot config now your your configuration file might be somewhere different wherever you've chosen to compile your dwm folder i've just done it in a success file because i have a whole bunch of other success 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.def.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 in config.iii so i'm just going to them into config.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 uh 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 uh and that's the biggest really the is the biggest difference between i3 and uwm is that you compile this code every time you make a change so if i change a color down here i can change you know change this color here if i wanted to i'm not going to because i don't want you know i have to with and redo it but you you change a color you save this and then you have to go through and run make and then you have to do sudo make oops install and enter your password and it will go through and make these files you know in 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 order to see those changes take effect now there are ways you can get around that by uh you know either with a patch or with something with your ex in an 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 it's completely different than r3 whereas in in i3 when you make a change you make a change in configuration file you save it and then you hit mod shift r and it reloads i3 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 uh this is something that i've added and if we do an ls here you'll see that i actually have c in ls so we can actually see it i i have like like eight 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 gonna end up having and basically what a patch is is exactly what it sounds like it's 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 i3 when you've downloaded that you get pretty much all the functionality you'll ever going to get with i3 it 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 a 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 that kind of functionality to it so but for example i wanted a scratch pad which is basically a floating terminal or floating uh application i have to add this patch here so if i zip into that dwm scratch pads basically what you're doing you're getting a a description of the pat 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 changed and it has 65 instructions so these are the things that it's going to add to the code so it's going to add to config.h it's going to add all the stuff with the plus to it okay and this and it even shows you where it's adding it to so it's adding in between this line here 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 uh actually i'm pretty sure that's supposed to be p1 not p2 map uh 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 it is your patch is going to fail 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 to go or use something like bspwm with with dwm you're looking at getting more invested in actually learning a programming language so with dwm you have to know some c you're going to learn that inevitably by using it now i came into this not knowing anything about and i've learned some stuff uh 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 uh i don't know why things are defined in those ways i can read the code fairly well uh it's not as uh in on 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 like commas don't always go in the same spot in lua for some reason i 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 plus plus 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 it 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 this the small nidalee 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 missed so i missed the ability to to assign each workspace keybinding so i as you saw in my i3 configuration file i have 19 workspaces and in in my essex hkd file which is um where i control my key bindings in i3 i can have key bindings associated with each and every one of those workspaces so i can i had super one through zero and i can access workspaces one through ten i hit control one through nine i can get through to my workspaces uh 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 chances are it 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 dwms 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 q tile 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 plus plus and and actually figure things out in terms of you know where semicolons go and you know how the patching system works then dwi 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 long time user of tiling window managers and for some reason you haven't used either one of these both do well really well um if you've used something like q tile or if you've used x moment x moment you'll probably be more comfortable in dwm if you've used something like bs pwm you'll probably be more comfortable in i3 because they're much more similar now bs pwm 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 those are both manual tilers so they're both similar in that way they're also both coded in user-friendly syntax ones written in bash one is written in whatever i3 is written in it so my best advice is to try both um i have a uh video where you can install dw 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 uh 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 gen 2 is going to be a little bit different because you got to emerge and all that kind of stuff i don't know how gen 2 works like at all i've never used gen 2 before maybe that's something i should do anyways thanks for watching you can follow us on twitter at the linux you can follow us on facebook at the linux cast you can support us on patreon at patreon.com linuxcast and with that in mind i would like to take a moment to thank our sponsors or our patrons uh 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
Info
Channel: The Linux Cast
Views: 11,104
Rating: undefined out of 5
Keywords: linux, open source, apps
Id: b9zSQY5wbr4
Channel Id: undefined
Length: 22min 52sec (1372 seconds)
Published: Fri Mar 26 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.