 Over the last year, DWM has become my go-to tiling window manager. It's the one that I've seemed to have settled on and used the most of the last year. Before that, it was I3, then I moved to DWM, and despite trying a whole bunch of other window managers, and I mean a whole bunch, DWM is the one that I keep coming back to. Over the last few months, I've had a few people ask me for tips on how to set up a suckless setup, and today that's what I'm going to show you is how to go about doing that. A few things you should know. First of all, this video is not universal. Second of all, my camera sucks. Sorry about that. This video is not universal. I'm going to be installing this in Oracle Linux, which is based on Arch Linux, and it should work fairly well for anybody who's using Arch or a derivative of Arch, but if you're using Ubuntu or Debian or another operating system, this is not going to work for you, mainly because there are dependencies on those distributions that you only need to install before you can actually go through and build DWM or Sucklet or ST or Dmenu. So I have made a video in the past about how to do this on Ubuntu. I'll link that in the video description below and put the card up top if I remember how to do that. That video should still work just fine, but again, if you follow the one that's in this video, the tutorial is in this video, just know that it probably won't work unless you're on Arch or an Arch derivative. So let's go ahead and jump in, shall we? Now, I'm going to be doing this in a virtual machine and we're going to be doing this from XFCE. So it really doesn't matter what desktop environment you're in. When you do this, you could be on a TTY if you've just installed Arch Linux. It doesn't really matter. I just happen to have XFCE here installed. So that's what I'm going to be using. So the first thing you need to do is obviously install the program. So we're going to need a terminal and I'll zoom in here. This is a Lackardy and we'll make this full screen so you can actually see. So the first mistake people make is when they download DWM, they sometimes either download it in their home directory or they download it in their downloads folder and both of those are a mistake. And the reason why is because you delete things from those folders all the time or from those directories all the time I should say. And if you end up deleting your suckless stuff, you're going to break your suckless stuff. So the best place for this to be downloaded is in your .config file. So what I recommend you do, even if you're not going to be using all the programs, let's just say you're wanting to use ST, but you're not you're going to be using DWM. It doesn't matter no matter what combination of suckless programs you do download them in your .config slash suckless folder. So what I'm going to do is cd into .config and I'm going to make directory suckless and then I'm a cd into suckless and we'll clear the screen there and then we'll do an ls. You can just see there's nothing in here. So the next thing you have to do is make sure you have get installed. So do a sudo in this case Pacman dash s get and you also need a text editor Vim or any other text editor will work. Vim is just the best one fight me. These are already actually already installed so we can cancel that but just make sure that those two things are installed and those things are pretty much universal no matter what distribution you're doing this on because you'll need get in order to download these things. You'll need them in order to edit the configuration files. So let's go ahead and download them now. So the first thing you want to do is figure out what software you want and in this case I want DWM ST and D menu. So I'm going to do DWM first and I'm going to scroll down here to the where they have the commands you need now you could probably if you've done this often enough you'll have this memorized it's just get that suck list or slash DWM that's all it is and we'll just paste that and wait for that to clone and actually what we're waiting for that we'll go ahead and go grab ST as well. There's a there's a command down here for you to copy and paste again. It's just get that suck list or slash ST but copy and pasting is easier and as we all know easier is better. So we'll go ahead and get calling that as well now somebody asked me in a comment the other day whether or not you have to use ST and the answer that is no if you're going to use DWM you don't have to use ST but what you do have to do is go into your config.def.h file and make sure you put in there the terminal that you want to use. I'll show you that in a minute but I was thinking about that and I thought I'd answer that question. So I'm also going to do D menu here and D menu is under tools D menu and then we can just copy and paste this here okay and now if we do own LS we'll see we have D menu at DWM and ST. So now all we have to really do is make these things. So you'll want to make sure no matter what distribution you're on that you have make install now in an arch Linux you'll want to have a park package called base develop now on Arco here I already have that installed but if you've installed vanilla arch you'll want to make sure you have base develop installed that's pretty much universal it's pretty I even if you're not doing a suckless build you'll want to have base develop because it has make in it and you need make for any number of things it also has several other things in it obviously as well so what we're going to do first we're going to CD into DWM and we'll do an LS here now before I make this I'm going to actually show you how to not to use ST so if I them into config.def.h and let's say you didn't want to use ST you know what we do is we just scroll down here to the point where it defines the variable for the terminal which is right here this line right here and what you could do is just change this here from ST to a lacquerty if you have a lacquerty installer kitty you're going to have terminal whatever you want and then you just write and quit this and then what we can do is do make and then pseudo make install okay and that did just fine as long as it looks like this you're successful if it comes across as an error chances are the reason why you got an error is because you have missing dependencies because there are several distributions that don't come with the dependencies you need to actually get this installed and most usually DWM will actually go through in the second command here the pseudo make install will it will actually tell you what dependencies you need to install so in this case it works just fine so I'm going to actually CD back up a level into ST I'm going to go ahead and build ST but we'll use a lacquerty so what we'll do here is do make or excuse me yeah we'll do make and then pseudo make install now I know there are going to be other people out there that would do this a little bit differently you could do pseudo make clean install there are several ways to do this this is just the way that I've always done it and I'm going to do D menu as well so we do dot dot slash so the fact that first thing what I'm going to do is do pseudo Pacman dash RNS D menu I'm pretty sure that Arco comes with D menu pre installed so I'm going to actually go through and delete this because I want to make it myself and the reason why I want to have it as my own package that I've made myself is because then I can go through and patch it if I choose to do so if you have the one that's installed from the A you are you can easily patch it because every time it gets updated or whatever it's going to overwrite your configuration files and that's not a great thing so what I'm going to do here is to make actually what we need to do is CD dot dot slash D menu and then we can do make and then we'll do pseudo make stall now you'll notice up here that there are a couple errors in the first version is usually you can just go ahead and ignore those as long as it makes the second time fine usually that just means that there are things that are unused in the code but you could if you know enough C plus plus you could actually go through and fix those if you wanted to so what I'm going to do now is CD up to the home directory and we'll clear the screen now the next thing you'll want to do is ensure that DWM is part of your login manager so if you're using a login manager like SDDM or LightDM or LXDM or whatever it is you'll need to go through and do this next step if you're not using it if you're using an excellent RC file what you'll want to do is go through and put DWM exact DWM in your excellent RC file or you could just do start X slash bin slash DWM I believe that would work I'm using a display manager so I need to make do this next step so what I need to do is do CD slash user share X sessions again if we do an LX here we'll see the only thing that's in here right now is the XFC desktop so what I need to do is do pseudo touch DWM desktop and then I'm going to do pseudo pseudo if it will actually take my keyboard again pseudo VIM DWM desktop and then we need to go into insert mode and type the following you need to do desktop entry and then close the brackets and then encoding equals UTF dash 8 and then name equals DWM and then comment I don't think you actually need to put the comment in there but I've never actually tried it without so don't quote me on that okay and then exec this for sure you do need and you're going to be telling it what to exact when you select a choice and then the icon equals DWM and then the type equals X session it was like that okay and you got to make sure you do that the capitalizing there right and then I always leave a couple extra spaces at the end I don't know whether or not that's that's actually something that you need or not but I found sometimes in these types of entries if you don't leave that extra space at the end things just won't work so get out of exit out of insert mode right quick right quit this and we're good now hopefully we're at a position where we can log out and log into DWM so what I'm just going to go ahead and do that and we can actually close Firefox there close this and then log out now this is awesome I don't know why it's not showing up in the full screen but doesn't really matter we need to go down here now depending on what display manager you use this will be in a different place if you use GDM it'll be down here in the corner like underneath where my video is if you use light DM or I think I said they're wrong if you use GDM it'll be down here in the corner if you use light DM it will be up at the top probably somewhere in the bar and this is SDDM so it's right here and because I'm in a virtual machine SDDM does not always like it so especially when you're in full screen so I need to get out of full screen go back into full screen see if it will work now there we go now see how this has an option for DWM just select that and do TLC which is my password you know because everyone wanted to know my password it's okay it's strong and complicated but you're not supposed to tell everybody your password it's okay it's not the password I use it's horrible alright anyways so this is DWM and it worked just fine so what we need to do is do alt enter alt shift enter I think is the right one here and alt is going to be your super key and alt shift enter is to get to your terminal now I want to want to do is go through and get the right display resolution here so I'm going to do X render dash S 1920 by 1080 and that will get us full strain so we can clear that out now you have a full DWM suckless setup here if you want to use D menu it's alt P that gives us D menu up here at the top if you wanted to use ST you'd have to find this because remember we changed that but ST is here as well if you want to close something alt shift C closes the window alt shift C again alt shift X would take you out of DWM completely and that's your suckless setup that's how you do it now another thing I get asked is how to patch DWM and ST so the process for patching any suckless software is exactly the same so I'm just going to focus on DWM but just know that if you're going to add a patch to D to ST or D menu or surf or something like that the process is exactly the same so the first thing you want to do is actually go find yourself the patches that you want to do so I've already done this but I'll just show you where to find these so if you open up Firefox and you actually have to know how to spell Firefox in order to you know open it I don't I don't know if you know this or not you actually have to spell things right in order to launch them it's done so you'll get you want to do is go to suckless.org and then go to DWM and then patches and then just find the patches you want to do now basically what patches do is they add functionality right so what they're doing is adding code when you so let's just say you want to do this bar height one let's just say you wanted to you click on that and then you right click and they click save link as and you'll want to make sure this is in your DWM folder within the suckless folder in your dot config folder the directory folder directory I'm always going to make that mistake so you save this into that directory and then you would go through and go to your terminal and you just CD into dot config suckless DWM if you do an LS here you'll see that file that you just downloaded and then you can go through and patch that now I'm not going to patch that one in I have some other ones that I'm going to patch in so what I'm going to do is go into my downloads folder and do an LS here I want to move everything that starts with that diff or ends with that diff into tilde slash dot config suckless DWM okay and then we do an LS that should be empty okay good now close that now if we do an LS here I'll have the ones that I want to do added so what I'm going to do is show you how to patch it's very easy so we'll just do CD we'll do patch dash P1 and then that symbol what that symbol is I don't know I missed that day in school it's either the greater than or less than symbol I don't know you could tell me a hundred different times in the comments below I'm never going to remember so I'm just going to call it that symbol and then what you want to do is the path to the tag but because we're in the directory where the patch resides we just can type in the name of the patch so in this case we're going to do DWM dash per tag and then enter this is going to be a little bit different than all the other ones because per tag doesn't actually look normal if it comes out like this it succeeded so let's do another one do patch dash P1 and then we'll do DWM dash attach below basically what this will do is we'll make it so that this the window spawns on the right hand side of the the screen instead of the left hand side of the screen we'll hit that and enter oops you notice what I did there on I forgot that symbol so there were that sign I do that okay that succeeded and you can see how this looks different now this is what most patches will look like the hunk basically just means a block of code and you want to see all the blocks of code succeeded and in this case it did so I'm going to go ahead and do warp next I'm going to do patch dash P1 I'm not going to forget the symbol this time and do DWM dash warp that worked just fine and then I want to show you what happens when something fails so the reason why I pre downloaded these tags or these this particular selection of patches is because I know if I do it in this order this last one should fail and that way I can actually show you what to do when something fails so if I do patch dash P1 watch it succeed this time because it definitely failed last time and then the one we want to do is DWM dash vanity gaps it's always a pain in the butt so we hit this and look at that we have some failures so and we actually I do have fewer fewer failures this time that I did last time but that's okay it's all going to be the same so in this position what you want to do is take note of the file that it saved in this case it saved us a file called DWM dot C dot reject this tells us two things first it tells us what file we need to check and see what changes we need to make and it also tells us what file it failed for in this case it failed for DWM dot C so whatever changes it tells us to make in the dot reject file we need to make those changes in DWM dot C so I'm going to go ahead and then into DWM dot C dot reject okay and in this case we have to delete some code and we know we would need to delete it because here along the side you can see all these minus signs that means you need to delete if you added a if you had to add something it would be a plus so sometimes you'll see in a reject file you'll see pluses and minuses that means there are code blocks that you have to add and you have to subtract and you would have to go through and do each and every one of those it will only create one DWM dot C dash that reject file so sometimes there's going to be multiple changes you have to make in this file in this case we just have to go through and delete some stuff in DWM dot C so I'm going to open another terminal and I'm going to zoom in so you can see and I'm actually going to move this over actually don't have that patch installed in DWM by default you can't move something you know to the top of the stack it's the dumbest thing I mean seriously it's like that that's functionality that should be by default but it's okay I should be able to at least make this bigger which I can okay so we're going to cd into dot config if I can spell suckless if I can spell DWM if I can spell and we'll do an ls here now remember earlier I told you to delete config dot h right so remove config dot h that way any of these patches that I've made will make it a brand new config dot h with the new patches so we're going to do is them into DWM dot C and what we want to do is find the particular lines is telling us to delete in this case them has done us a favor because I've actually gone through and done this once and OBS stopped recording and I hate OBS and OBS needs to die not right now it can die after I'm done recording anyways them has remembered where I was before and basically what I wanted what I need to do is delete these lines here all the way to where it says so in this case we need to delete from void and title monitor asterisk them all the way down to right before void toggle bar so in this case we'll just go through and do this so we'll just keep going down using in visual mode until we get to void toggle bar and we'll let delete and then we'll hit dd to get rid of a couple of these extra spaces will right quit on that and we'll do make okay and we'll do pseudo make install and then enter password hi there Matt from the future here a couple things that I didn't cover in what I was just talking about two things first of all when a patch fails just know that it's not always DWM dot C I didn't really mention that I kind of implied that it was always DWM dot C that fails but every once in a while when you install the patch you'll have failures and other files as well that file that gets popped up when you get mentioned it fails so in this case it was DWM dot C dot reject or dot R AJ if you have other files that also have failures you can see those in that output as well so you might see config dot def dot H dot reject you might see one of the other ones just know that if you have rejects or you have failures in multiple files or in different files you'll have to correct each and every one of those failures in order for your patch to work so for example the time before when I did that patch before OBS crashed and everything made me sad I had two different failures I had one in config dot def dot H and I had the one that I corrected on camera that you just saw so I had to go through and actually correct both those now the reason why I didn't have that second one the second time was because I hadn't made any changes to config dot def dot H in this version of DWM because I'd had to delete DWM in order to rerecord stuff so that's the reason why I only had one failure but just know that it's possible for you to have failures in multiple files and you want to make sure you pay attention to those reject files because it's possible that you have more than one the second thing that I wanted to mention is that I didn't do this correctly okay after every single patch that you install you'll want to make and make install or make clean install whichever one you decide to do don't do as I did and go through install a whole bunch of patches and then rebuild your DWM configuration because the way I did it ended up working fine as you'll see here in a minute but it's possible that if you go through and install a whole bunch of patches and then make something it's possible that you'll have errors in your build in your when you go through and recompile and you don't necessarily know which patches the one that went through and you know caused you the problems because you've installed five or six patches so always do not what I do go through and install patch recompile reboot or log out and log back in make sure everything's hunky-dory before you go through and do another patch always do that I'm going to talk about later about making sure you back up after every single patch so make sure you pay attention all the way to the video before you start patching stuff because a lot of the stuff is very important and unfortunately I didn't go through and do this in the right order so I'm recording this much later while I'm editing and I was watching it's like Matt you're going to cause a lot of people a lot of problems if you don't tell them to be very careful in terms of how they go through and build their stuff so again just to reiterate make sure you build after every single patch and also pay attention to the end of the video because I'm going to talk about backing up your files before you make patches and stuff like that so back to past Matt as he continues on with the patching process and that's done so if I go through and do super shift Q and now and log out and then get myself interestingly enough I I made a mistake earlier I don't know if anybody caught it but I didn't realize it did I made changes to config.h instead of config.def.h when I changed my no I didn't oh you and I know what I did wrong remember I said OBS failed I didn't make my changes to the config.def.h to change the terminal and to change the my key bindings again because I actually had to go through and delete DWM and start over again so never mind me I know what I'm doing it's okay so we're going to do is X Rander to get my display resolution back 1920 by 10 oops by 1080 okay and then to zoom in ST it's super shift page up and we'll clear this out so so now that we're actually back in DWM and got things up and running again and we know that it works because we've logged out and log back in and everything's working fine that's how you patch and that's how you fix a patch when it fails you'll notice that you'll find your patches failing more as you add more patches so the what basically what patches do is they add and subtract code and that means that the code in DWM.C and config.def.h that code moves around to different lines right and sometimes those lines that are supposed to be there get deleted by patches that's what those diff files are they delete and add blocks of code and the more patches you add the more different your code is so that any new patches that you add are looking for code that is either in a different place than it used to be or should be by default or doesn't exist at all and that means that your patches will continue to fail more and more as you add more patches I've never gotten to the point where I can add more than seven or eight patches in a stock version of DWM now there is a DWM fork called flexopatch or something like that that will probably allow you to add more patches because it does some magic but if you're just building DWM the way I did you'll notice that once you get to seven or eight patches you're going to probably have reached your limit especially with patches that affect the bar because the bar has a ton of variables that set the width and the length of it and each patch kind of messes with that thing and changes the variables and the changes the variable names it's really kind of a mess so the more patches you use that affect the bar the more apt you are to find ones that fail especially ones that deal with color deal with transparency the alpha patch for example those things just fail all the time and you'll get to a point where even if you go through and manage to fix the patches manually like I just showed you how to do you'll get to a point where DWM just will stop working because the patch or you'll get to a point where your patches won't work and that's because you'll have patches that are just incompatible they'll never ever work together and there are many like that so if you can even if you've manually patched a patch in and it just won't take that means that you have some other patch there that's just they're just conflicting so the biggest tip I can give you is make sure you back up your files your DWM and your suckless files every time you make a change so a lot of people do this through get so you can go through and create a get repository for your suckless files and then every before you make a change push those files up to your get lab or you get hub that way if you've made a change to your DWM and you've made a patch and it doesn't work and it breaks things you can just pull that back down and go back to your old working configuration do this every time before you've made a patch change that way you always have one version of DWM or suckless or ST or DWM or D menu I can't talk that works that you know works if you don't want to use get just do a CP dash R on your suckless folder that I showed you how to make and save that somewhere else so you have a backup and do that every single time you make a change before you made the change that way like I said if something goes horribly terribly wrong you have a backup and you don't have to worry about going through and starting completely over I'm not very good at doing the backup thing on DWM I get really excited about the patches and then just go through and do pow patches or patches on patches on patches and eventually I regret it so don't be me do as I say not as I do I think that's what the way that goes anyways now I have to go figure out how to edit this video which is now in two parts so that's what I'm going to go do if this video has been uploaded you'll know I've been successful and it should be happy days if you don't see this video you'll never know because I'm just here talking to myself so if you want to follow me you can do so you can follow me on Twitter at the Linuxcast you can support me on patreon at patreon.com slash Linuxcast before I go I'd like to take a moment to thank my current patrons Devon Marcus, Megwin Donnie Sven East Coast Web Chris Mitchell, Mr. Fox, New Patron American Camp thanks everybody for watching thank you for your support I'll see you next time