 It's not a big secret that DWM is my favorite tiling window manager and it has been that way for quite a long time really It's been probably close to two years Since I installed DWM for the first time and I remember when I first got it installed that I was really really happy with my accomplishment I thought I really accomplished something because DWM is this really hard window manager to install and I Succeeded it was fantastic, and then I installed Xmonet and realized DWM is way easier so DWM is actually a fairly easy window manager to install if you know what you're doing and It's not even that hard for if you don't know what you're doing So the point is I've been using DWM now for quite a while and I know quite a lot about it I've learned quite a bit of the configuration file and a lot of the source code And I've learned a lot of how to do things in it as you do when you use something for quite a long time But that doesn't mean that I know everything, right? I've always pride in myself on learning new things and one of the things I learned least recently was that there's an easy way to Switch themes quickly in DWM. It's not really a new thing like if you know anything about DWM You know, there's a way to Include certain snippets of code from one file to another and you can do this in a lot of languages Sometimes it's they use the word source sometimes they use the word include sometimes they use something different But the point is a lot of languages allow you to basically import Contents of one file into another file and basically that's how you can do this So let me go ahead and show you what I've done because it's actually kind of neat Okay, so here we are in a Lackardy and this is just my DWM Configuration file. It's just basic. I've gone through and done a lot of patches and stuff like that Everybody has seen my DWM set up time and time again every time I show you something on video This is probably what you're seeing So if you want to do this, there are several things you need to know So first remove your config.h file because we're going to be compiling DWM again after we make the change So we'll remove that and then we're going to vim into our config.def.h file And you can see right away mine looks different than most configuration files because normally In a DWM configuration file after the DWM font line here, there are several variables That are called and defined that define colors that then are used in this section here to Attribute them to certain parts of the window manager, whether it's the bar at the top the the board or whatever You know, that's how it works You declare the variables and then you use them later on in this part here But I don't have that in this file at all Instead what I've done is taken that part out completely Don't delete it copy it and then I've gone through and included this line here So hashtag include and then a file path to A particular theme that I want to use. So in this case, I'm using the Dracula theme I haven't changed the wallpaper because I've already done this video once and it didn't work out So forgive the wallpaper not matching but the point is if I want to change Themes all I have to do is change just one word to A particular theme that I have already created. So in this case I can change to One dark Okay, so I just write and quit this And then before I compile DWM What I'm going to do is show you what the theme files look like so I can cd into my themes folder And if I do an ls here, you'll see I have several themes that I've created over the last couple months or so And I can use any one of those by just changing that one word in config dot def dot h and then recompiling So let me show you what one dark looks like. So I'm going to them into one dark dot h and That's all it looks like Now like I said at the beginning They include functionality all that does is sources this file into my config dot def dot h file It pulls all these values in as if they were there already But it's just one line So you only had to change that one word when you want to change something Instead of having to go through and change each and every Color code there that you know to change the colors And all of the themes look exactly the same the only thing that changes Is the the hex codes here And I can show you that if if we can just go ahead and vim into monokai Looks the same vim into dracula looks the same And that's the way with all of them and it doesn't really matter how many colors you have defined as a variable As long as every variable that you define you also use later on in config dot def dot h So if we cd back up a level And and vim into This here again every variable that you define in your theme folder has to be used Here in one of these two areas or how many ever other areas that you use So there's a lot of different places that you can define colors and call for colors in dwm I just happen to have these two other patches Necesses necessitate you have other places here But as long as you when you call those or when you define those variables You have to use them all here. Otherwise, you'll get an error when you compile So that's the only thing you have to really look out for I happen to have an extra Variable they're called col underscore gray five that isn't normal And a lot of people have more colors called than I do way more So that's really all there is to it all I've done is created a whole bunch of theme files like I showed you And then when I want to switch between one I go up here and change this one word And then I go out of here and do make Pseudo make install And then I enter my password and then what I can do Is reset the dwm so I'm going to cut the video away from here because when I reset dwm all my windows go to the first tag I want to fix that before I go through and show you what it looks like Okay, as you can now see I have a one dark color scheme in every place except for sl status now The thing is sl status is also written in the same language dwm is so you can do literally the same thing. So if we see Clear this up a level and then into sl status and then remove config.h oops Actually have to finish typing that and then we go and do an ls here. What we can do is go into config.def.h Go here at the bottom So this is the top. This is the bottom and then change the exact same word It's the exact same line, right? We just In a different file so change this to one dark Saving quit and then if I'm going to show you the theme file for the sl status if I go into Themes and then into one dark. This is what it looks like now Basically what I've done is the exact same thing only it's different lines obviously the way sl status does things is going to be different than dwm itself And what we've taken is normally this part here would appear at the bottom of config.def.h I've taken it out and put it in each of my theme files And each theme file has different color codes. So in this case, this is the one dark color codes that associate to the icon and the text and all that stuff So when I compile sl status and then restart it It will call This particular theme file instead of the one I was using before it's the exact same process as dwm It just has different things in the theme file. I hope that makes sense One last thing make sure if you if you're going to do this and not use my theme files Make sure you get that semicolon there at the bottom If if you go down here at the bottom There is a semicolon make sure you copy that over as well And then it's it's in each of your theme theme folders Or theme files because if you don't you'll get an error Semicolons are important That's the lesson you should learn. Okay, so if we get out of this and then we see the upper level and do make pseudo make install And then kill all sl status You can now see sl status has come back with one dark coloring And that is how you change themes really quick Now Some of you probably are wondering What the purpose of this is and why it's so cool and why I'm so proud of it because I mean really It's not that big of a deal. I mean, I'm sure those people who know how to code Know how to do this stuff better. This would have been very simple for them But it was a eureka moment for me even though I knew that you could include Files and and then kind of import them. I know that's not the right word into that particular You know a different file. I knew you could do that. I never associated that with being able to Manage multiple themes and you and once I had that eureka moment It was really cool and that's because Prior to this discovery the way I managed themes was messy I mean at one point I was uploading a different repository for like four different themes that I switched back and forth between All the time I had, you know grubbox and dracula and purple and ocean And I was always rotating between them and in order to do that I'd have to delete my whole dwm file pull down the new the theme that I wanted to change to recompile that way It was a mess. It was also stupid because there was obviously other ways I could could have done it at one point I had all of my theme folders that are theme Theme to dwm config folders in a particular Folder on a computer and then I would copy them over and then recompile and that was a mess as well So you can see how this is way easier and I can't even begin to tell you how many themes how many rices that I lost just by overwriting them because I just decided not to Save them at all So by doing it this way and creating every time I decided to write something I just create a new theme Dot h you whatever I want to call it. Let's say I wanted to do a nord So I do nord dot h put that in the theme folders for both dwm and in the sl status Theme it from there Do it through and do all the color codes Just like I would normally do a rice and then change that one word in the config files and then recompile And I've changed the theme and then when I want to switch back and forth I have all the themes that I've ever created in that one directory And it's easy to just change them one word and recompile. That's why it's so cool so If you want to do this yourself You can either go through and do it as I have shown you or you can just download my suckless utils Repository that's on git lab the link is in the video description It has all of my themes right there for you to try if you want to try this out You will have to put up obviously with my particular patches and such, you know Because it's my dwm file. So anyways that is it for this video if you have questions There needs some help you can leave those in the comment section below or hit me up on twitter at the linux cast 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 Devon chris east coast web gen 2 is fun true patrick all primus city marcus magland jackson Abdul steve michael artson and amityas merit camp jasually j dog the bsd these rock and peter a Thanks everyone for watching. I'll see you next time