DWM-Flexipatch - DWM Has Never Been This Easy!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome back to the otb channel so dwm has got this mystique that seems to surround it uh it has this reputation of being really hard to configure basically because you have to manually patch it to add in functionality but no longer there is now something called dwm flexi patch out there which makes the whole process of patching child's play anybody can now do it see you after the intro [Music] okay welcome back so we're going to talk about dwm flexi patch today um as you know i'm a big fan of dwm i've been using it since june 2020 and of all the window managers i've tried and i seem to have tried many it's the one that i seem to use the most it's not perfect though when i first started out with dwm i really wanted some sort of color in my bar and i tried a patch that was meant to add color to the bar and it did but it slowed the system to a halt and that's how i ended up using color emojis in the bar but that patch that i put in is still in my build which hasn't significantly changed since i i put it together in june of last year and it's always been a slight annoyance that it's there so i thought to myself right it's time to rebuild dwm completely and to repatch it and to take that old patch out and to replace it with something called a status 2d patch which i've heard good reports about but i i have to say that the thought of applying ten patches um wasn't filling me uh full of joy because whilst the dwm is a great window manager and it's easy to install applying the patches can take a lot of time initially they'll all apply quickly you know with a straightforward command but as all the lines start to change as the files change you end up having to manually patch and the more patches that you add the more problems that you can come across as different patches conflict with each other so i was really happy when i found something called dwm flexi patch which purports to take all of those problems away and to create a really easy way of patching in under a minute where you simply have a single text file and you change an entry from naught to one so that's what i've been playing with and i've been quite successful and uh i'm really pleased with the output um first of all i think it's important to say that before if you're going to play with this it's a good idea to know beforehand what patches that you want to include um i will put the patches that i use down in the video information and i'll also stick them up here somewhere just so that you can see them um these are the patches that i'm comfortable with that give me the flexibility and functionality in dwm that i enjoy uh your choices may vary accordingly let's get stuck into it though i'm going to use the virtual machine the slackware virtual machine that i fired up over the last couple of weeks and we'll use that as a vehicle to demo this right so you should see on your screen now um a web browser that's actually running on my slackware virtual machine i have to say i'm only using slackware here simply because it's already here it doesn't really matter which distro you use the process is is pretty much the same but you can see the dwm uh website up there and the process for installing dwm is actually straightforward there's not a huge amount to it you would uh do a git clone move into the the directory and do a pseudo make clean install make sure that you've got your x in it rc configured or if you use a window manager you'd have to create a desktop file and then you start adding functionality to dwm and this is where you go to the patches page and there are many many many patches now you don't want to be applying too many because the problem is as i've already said some can conflict with each other and ultimately although there is an easy way to to run a patch command after your first couple of patches because all the lines in the files are going to move automatic patching is going to fail and you're going to end up doing manual patching and this is really what put me off creating another build of dwm until i came across this uh github page by baccaby i hope i've got that right uh and he's uh got a repository here called dwm flexi patch now i won't pretend for one instant to understand exactly how how it works but as he says here uh it takes a completely different take on patching in dwm because it uses pre-processor directives to decide whether or not to include a patch during build time so let's put that into english what it means is rather than having to patch the source code yourself ultimately all you have to do is open up a configuration file and yes i know in theory dwm doesn't have configuration files it has source code but okay you open one of the source code files it contains a list of all the patches and you simply look at all the patches and if you want one it will be down like this one here which says define bar alpha patch it will have naught on it to start off with if you want to activate it you simply click one and you go through this configuration source file you choose the patches that you want you set them to one and then you do a pseudo mate clean install as simple as that or that's the theory anyway and you end up with lots of different patches and you can go back into this uh into this uh repository of course and you can try different patches you can remove different patches so in theory it sounds absolutely you know a godsend you may however he says here may not like essentially the fact that the files even when you've just got your patches applied are going to have a lot of that extra bump in them and i did see what he meant when when i had a look at this this week and so he provides something called flexi patch finalizer which can actually once you're satisfied and you've got the patches that you want it can simply clear out all the rubbish that you don't want and just leave you with your final version so okay all good in theory so let's clone this i've i've got my terminal set to uh i've created a new directory called sucklus let me just clone this directory here in this success directory and it's simply a case of git clone um right so there we go let's bring that down well that was nice and easy let's go back to the browser and let's have a look at this other page that or this other package he mentioned called flexi patch finalizer and let's do the same here let's copy the url and let's also get clone that job done okay i think we can uh shut down the web page now and let's just uh make this full screen let's just clean it up a bit you can see here we we've got actually a number of uh different packages that i've downloaded i've downloaded dwm flexi patch flexi patch finalizer a little program called sls status which i'll talk about after and i've also downloaded the st terminal um i have already installed that if i type st here you can see st opens up and unless you change the default configuration in dwm it will expect you to have st installed installed so let's go into dwm finalizer flexi patch rather and you can see here that we've got all the standard sort of files that you would expect and i'm sorry if you can hear what's going on outside but the rain has just started hammering down like you wouldn't believe so i'm not going to try any patching uh initially i'm just going to run sudo mate clean install and see what we end up with so sudo make clean install enter my password and let's see well no errors that seems to have compiled cleanly so when we talk about having to compile the dwm it isn't a huge job it happens in a second or so let's see what we've currently got i'll set up my x in it rc file because i'm in slackware and let's boot into a plain vanilla dwm so here you go um i've just uh after setting up my x in it rc um logged into dwm i did put nitrogen uh into the x in it rc just to give us some wallpaper right from the get-go so that you weren't looking at a black screen but this is essentially what you get this this is a plain and simple vanilla dwm you have nine tanks up here which represent your workspaces although we call them tags in dwm you've got three layouts by default you've got this master and stack layout which i'll show you now the mod key is all by default and you would do alt shift and enter i've not changed my terminal over to alacrity so this is still st and it's a fully unpatched st if i open two more terminals you'll see that they open in this master and stack layout if i want to shut them i do alt shift c all good if i want to move to a different layout we'll actually let me open up a couple of terminals you've got some options here at the moment it's in this tiled layout but i can move it to uh these are floating now a floating layout or you can actually move it to uh i was going to say you could move it to a full screen layout but it doesn't seem to be configured for that at the moment out of the box but no matter we're going to deal with all of that anyway there's nothing on the bar at the moment which we would expect because i've set nothing up but you've got the basics of your window manager so let's go on let's see what we can do with this right so we're we're now back on uh the standard xfce desktop and it's time to start playing so we go into our dwm flexi patch folder and when i first compiled it it did actually create a config.h file and for the time being i'm just going to delete that and it created a patches.h file and i've deleted that as well what i have open though is this patches.def dot h file and just so you can see it nice and clearly i'm just showing it here in mousepad and this is simply a text file that has a whole list of patches and if you want to change some or apply some of these patches so you can see the status 2d patch here that i wanted to apply i just change it from a naught to a one as simple as that no other work required and i've gone through this ideally you want to know what patches that you want but if you don't this is pretty good well commented this file and you can see exactly what each and every patch does if there is any issues here any any patches conflict with any other patch uh the comments will actually tell you that so it's nice and straightforward and i managed to set my 10 patches that i wanted to one in under a minute just by using the search bar in my text editor so that's all good we've got that done and that's all there is to patching with this so all i need to do now is to open up a terminal again and let's go full screen and to cd into success and again into that dwm flexi patch folder and to run sudo make clean install again now i wanted to show you this with the error because i've come across it before this is compiled but we've got a warning message and the warning message is telling us basically that we've got a function defined in uh in our configuration but we're not using it now when i first got this i thought right i appreciate it doesn't really matter but i've got a little bit of ocd and if i'm compiling something from source i want it to be perfect um but luckily when i went back on the github page and i looked in the comments i found the answer and the answer was pretty simple actually all it is is let me just open this all it is if i open this with mouse pad again is there is a patch here called bar status where do we search bar status which the author has actually enabled by default if we can just find it bar status you can see there's many many different types there we are at the top so now that's set to north all we should need to do is recompile so let's try again and hey ho the error has disappeared so what have we actually got now um so if we go to our our uh dwm flexi patch and we open up the the standard configuration file that we use which would be config.h and we open up with that with mousepad what we will see is actually this is a much longer file than normal because essentially it has all the gubbins that you would include if you had all the different patches installed and it's got lots of if statements here you know if that patch is installed do this if this batch is installed do that and personally i found this unworkable for me it was just too much there to to quickly configure it so okay so it's time perhaps to to have a look at this other little uh utility that the same author has created called flexi patch finalizer and if i read the readme there to see what it says uh what does he want us to do right so here essentially we just run flexipatch.finalizer.sh with a minus r to say yes we do want to run that script then we have a path to the directory where we want to run it which will be that dwm flexi batch and then we have the possibility of creating an output directory where we want the processed files to be put okay well that sounds good to me so let me just shut that down well or minimize it should i say and let me open a terminal again and let me cd back out to the success directory route and i'm going to create here another directory where i would like this flexi patch finalizer to dump everything that it's done so make directory and we'll just call that dwm now i'm going to cd into flexi patch finalizer and i'm just going to remind myself of uh what we need to do so i need to do sh dot flexi patch finalizer so sh dot flexi patch never mind that just do flexi patch finalizer a minus r to say yes we do want it to run a minus d to point it to the directory i want it to process and i want it to to process the sucklus dwm patch directory and i wanted to put everything into this new directory that i've just created called dwm okay so hang on to your hats let's see if it works okay it's run there's been no output so i'm assuming everything has worked well so let's come out of there and let's go into our new dwm directory which i'm hoping is now going to be populated so let's have a look and it is indeed populated can i run a sudo mate clean install on that yes i can and it seems to have compiled cleanly and the best thing about this if i uh just show you on a file manager again i've got this new dwm file there and if i go now into my config.h it's much cleaner all above about uh you know the other stuff that i didn't use in the patch has disappeared and i've got a normal config.h file which is now manageable and i can get on with with customizing this to my heart's content which is great um and if i want to go back and i want to play around some more i can always go back into a dwm flexi patch i can mess about with the patches remove some add some more on and then of course just dump all the processed files that flexi patch finalizer has sorted into another new directory and play with that so i've now got a config file let me play with it and let me show you what what i've actually ended up with right so just to kind of finalize this um what you can see here now is uh what the result of my playing has been um you can see that i've uh changed the tag icons to awesome icons and i've actually made use of that um status 2d patch and with a little script called sl status i've managed to actually just use some standard awesome icons and color them which is great because it means that if i can't get the uh the lib xft bgra patch on any other distro i can always use this build so from the color scheme you can probably see that i'm playing with solar eyes dark here just having a slight change from my normal nord theme and i've got alacrity launching and all very nice and you can see it's all color-coded i've got some nice gaps here um i can of course change my focus between the windows that's not a problem and uh you know all color matched if i i want to make the windows bigger or smaller well that's great i can do that really easily uh if i want to rotate the stack i can do that all quite nice i've also messed it out getting my ropey all color matched as well and uh i've been really happy with it i've got this build currently on my t420 thinkpad and i'm incredibly pleased with it just before i go though um i think it's worth saying that uh the sl status patch uh sorry not patch program is also available from uh the suckles guys and in much the same way you just do a sudo make install uh and from here you've got a config dot h configuration file which basically is a readme for most of it and it tells you how to actually lay out your bar and i've just got a few things here you just copy basically what it says up here or you can run your own command and so you've got a function there it can be a run command which you put in yourself or it can be one of these these commands up here you then use the uh status 2d patch by using this format a carrot followed by c followed by the hex number of the color followed by the carrot again and then basically what you want and the command that you're going to use i'm not going to go into too much detail about this because if truth be known i'm probably not going to keep it i'm probably going to put my own bash script together which is is essentially what i've been working on so far um whilst i've been using the color emojis but i am quite impressed at that status 2d patch that it doesn't seem to slow the system down at all so that's all there is to say let's go and have a chat so that's dwm flexi patch and as you can see i've gone all solarized dark at the moment um as i say i've got it on my t420 and it's been there all week and i'm really enjoying it and i think it really does make dwm friendly because the patching is the thing that i think prevents a lot of people trying dwm out so the more people that know about something like this the better i'm not quite sure what the success guys will think about this with their minimal code etc but hey you know it works and that's all i'm bothered about um sls status um good little pro brac program for creating a bar i'm not going to use it long term i am going to create a bash script based on the one i've got already and i will no doubt just continue to play so i hope you've enjoyed this guys um as usual what i would say is uh if you like the video please like and subscribe if you'd like to support the channel you can go to patreon.com old tech blog and support me there or you can buy me a pint on my website i'd like of course to as always thank my uh patreons and i'm just dragging the names over we've got robert aristotelis storm picks mike ty forrest patrick glenn magnus darren and the latest member miz love ms lav um i'm not going to attempt you your surname as i don't want to butcher it but thanks very much mate it's much appreciated right guys that's it for today and i'll see you next week
Info
Channel: OldTechBloke
Views: 3,588
Rating: undefined out of 5
Keywords: oldtechbloke, otb, linux, oldtechbloke youtube, old tech bloke youtube, dwm, dwm-flexipatch, patching dwm, easily patching dwm, patching dwm in less than a minute, dwm-flexipatch-finalizer, solarized-dark, configuring dwm, dynamic window manager, window manager, best dwm patches, dwm window manager, dwm window manager tutorial, dwm patching guide, config dwm, linux tutorial, suckless software, open source, window manager for linux, window manager guide, dwm patching for everybody
Id: 9AoCHMIO5Ew
Channel Id: undefined
Length: 27min 24sec (1644 seconds)
Published: Sat Oct 30 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.