 I can't help but notice the resurgency and popularity of DWM, and the last couple years, a lot of people are giving DWM a serious try. DWM is a very old tiling window manager. It's been around forever. And really, a couple of years ago, two and a half years ago, I started giving DWM a little bit of love on my YouTube channel, giving it some coverage. I'm starting to see a lot more Linux YouTubers also giving DWM a serious try. And now that we have all these people getting into DWM, all these new users trying it out for the very first time, some of them are having problems configuring it to their liking. I'm getting support questions. Here lately, I've been getting a lot of questions about the panel within DWM, because by default, it's a very plain panel. You can't do a lot with it. There's no real configuration options, at least not in the standard DWM config file, which is the config.h But what I do for my panel in DWM is I use a third party program called DWM blocks. Let me show you. So I'm going to pull up a VM here. This is a VM of ArchBang Linux, which is an ArchBase Linux distribution. And all I did was I went and grabbed the source code for DWM from suckless.org, the website for all the suckless software. I did a quick get clone of the DWM source code and a pseudo make install. And this is unpatched vanilla DWM. And by default, the alt key is the modifier in DWM. I did change it. So the super key is my modifier key and super shift enter should bring up a terminal. So super shift enter a couple of times. You see we have the default master and stack layout. If I do super shift C, that closes the window with focus. And I could close all those windows. Super shift enter one more time will bring up a terminal. And you see the panel is very plain. It doesn't give you a whole lot of information, but it gives you what you need, which is what workspace you're currently on, whether there's a window open on it or not. We have our current layout. The symbols here tell you that you're in the master and stack layout. If I click on it, now we would be in floating layout. I'm going to click back off of that to get back into master and stack. Then the highlighted portion here is letting us know what the title of the window with focus currently is. And the title is fish because we're in the fish shill in the terminal. And then at the far right, we have the version of DWM, which is DWM dash six dot two. Now this area here is actually the part of the panel that we can configure. So we can actually overwrite this here and we can set that to be any text we want. And it can be difficult to do this because how do you do this? Well, really, for what most people want to do, you're going to have to use a little bit of shell scripting. You're going to have to write a shell script that replaces this text here with whatever output that you want to be displayed in that section. So let me zoom in here in the ST terminal unless you've changed the key bindings. Control shift page up and control shift page down for zoom in and out. So control shift page up will zoom me way in here because I want you guys to see the commands I'm going to run. I may do some scripting here as well. So I'm in the fish shell right now. I actually should switch over to bash if I want to do some scripting because fish has some different syntax. So let me switch over to bash and then I'm going to run this command here exit root space dash name. And what this command does it changes the name of the X 11 root window. So if you're inside a X display environment, imagine everything you're seeing on the screen is inside a window and that is the X root window. You can actually use this command here to set a name for that root window that X root window. I don't know like a real world example of why you would ever need this, but the fact that this command and this flag exists, the suckless guys have that actually output to this top right corner. That's how you overwrite what's going on here with DWM dash six dot two. You run this command and it will overwrite that and whatever we set the X 11 root window name to that's what will appear. So let's do exit root space dash name space and then going to wrap this in quotes hello comma world exclamation. And then in the quotes there and you see we now have hello world being displayed in the panel. Now of course, you don't have to just type plain text like that you could actually run a command and have the output from that command set the root window name. So let's do exit root dash name and this time I'm going to do a dollar symbol and why don't we run a command how about I'm going to run uptime. This is how long the computer has been running since the last reboot or the last restart it didn't like that because I think I also needed to wrap this in double quotes and there and now we have the output from the uptime command which is uptime the number of users and the load average of our computer. Now you can see how this starts getting complicated because the more information you want to put in this the more you really you have to write a lengthy script for this because you probably didn't want all of this information from uptime and it's going to be the same for most commands you don't want all of the output typically you just want certain pieces of it for example maybe I didn't want all of this you know maybe I don't want the uptime maybe I only wanted the load average maybe I only wanted the last part of the load average well to accomplish that I mean we have to start you know using things like said I'm going to have to pipe this through said and then I'm going to do some single quotes inside the single quotes I'm going to do a s really I just want to grab that very last field so I'm going to do s slash and then I'm going to do a period asterix comma and then two more slashes too many slashes there I only need to at the end let's hit enter yeah and then now I just get the last field of that load average zero dot zero now imagine that I had about eight or ten things I wanted to display here and they all involved you know me taking output of a command and maybe piping them through grep said all maybe multiple instances of grep said or all you know you really end up writing a proper shell script to just display a little bit of text here and by default you can only display plain text in DWM's panel you're not going to have any kind of unicode glyphs you can't have colored emojis or anything like that without jumping through some hoops doing some patching and installing some extra packages on your machine those of you running an arch base system which is why I'm using this arch bang vm there is a package available in the a u r that will help you get those colored emojis and unicode characters to properly display in your supless programs and typically what you want to do you don't want to have to open a terminal and type stuff to actually have it output in your panel right you just want all that to be done auto magically and how you do that is with a auto start script of some kind maybe you add what you want here with the x set root dash name command to your ex init rc file those of you that use start x to log into DWM there's some creative methods to get this to work right but what makes this a bit easier is just use a third-party program called DWM blocks it makes all of this so much easier so let me pull up DWM blocks here in a web browser here so I'm gonna just search for DWM blocks and I don't think there's like one standard DWM blocks version anywhere a lot of people have taken it and modified it and done their own thing but this one here by toran fail I believe this is the one that I initially downloaded myself and I modified to my particular needs and just grab this particular guy's version of DWM blocks so I could do a quick get clone and I could actually install this really fast here let me get back into the terminal here I'm gonna run a get clone and we're gonna run that URL behind it and this will clone that particular DWM blocks repository and then let's cd into the DWM blocks directory there and do an ls you guys can see there's really not much to it there's really two files there's the DWM blocks dot c file and then there's blocks dot def dot h which is your configuration file and I'm just going to leave it as is by default so I'm going to do a pseudo make clean install assuming I can type install correctly and there we go and now let's run DWM blocks from the terminal here and that is the output from this particular program if you wanted to see the configuration file let me do vmblocks.def.h and it's set up in a very easy to use format he's got these comments here he's telling you wrap everything in the curly braces here and then he has mim colon as the first field you see mim colon and basically think of that as a label or he's saying it could be icon you could add a unicode glyph or a colored emoji here if you had DWM patched to accept such a thing and then the next section is the command and he's running the free command which is letting us know how much free memory is available on the system he's piping that through awk because he just wants certain fields printed out he wants field three followed by a slash followed by field two and then he's piping all of that through sed and doing a substitution command in sed and then he's also running the date command down here to get the date and time and he formatted it exactly the way he wanted it there are two other columns to talk about here as well there's update interval and update signal and that's these numbers here so update interval obviously is how often these commands are ran again to be updated so he's running the free command for the memory command every 30 seconds he's running the date command every five seconds it's very easy to configure this thing i mean i could go in here if i wanted to and you know paste a new line and i could edit this maybe i wanted to do uptime so in this particular field for icon or label i could do something like upt colon kind of like what he did with milm colon for the other command here and then what i could do is he delete all of that i don't need any of that and then in quotes here run the uptime command again maybe i wanted to pipe it through sed for some reason maybe i i only wanted the load average maybe i only wanted the uptime but for now let's just run the standard uptime command and of course in that with a comma and then we needed another field we needed the update interval for uptime i don't really need that to run that often that's every 60 seconds you know every minute is probably fine and then finally we needed to end that with some curly braces and a comma one more time and then if i write and quit and once again do a pseudo make it clean install let's rerun the dwm blocks command and see if that actually updates and it's actually the same thing so what is the problem here because i have blocks dot def and blocks dot h we need to remove blocks dot h typically when you run pseudo make install on these suckless programs remove the config dot h file and just leave config dot def dot h which in dwm blocks here it's blocks dot def dot h and blocks dot h so let me remove that and then run the pseudo make install one more time and we have an error and it looks like i forgot the comma between the 60 and the zero there my bad on that so let me get back into this fall and it's very easy to correct that and that comma colon wq to write and quit pseudo make clean install but we have to remove the blocks dot h file again pseudo make clean install finally and now let's run dwm blocks and it updates but we have two of them running we have this one but just for a second you saw the longer one that included the uptime also flash on the screen that is one of the things you can't just override the exit root name without you having multiple instances of them running without a reboot of the machine just logging out of dwm actually won't fix the problem i'd actually have to reboot the machine to actually change this stuff but before i reboot what i really want to show you guys is you guys go over to my get lab and those of you trying out dwm and if you want a panel with dwm blocks and it's already patch for emojis and cliffs and everything go to my get lab at getlab.com slash dwt one and go to the projects link here and choose all of my projects because i have like 12 or 15 repositories and by default it's just going to show you a few of them but you want to take a look at all of my repositories and i have builds of a lot of the suckless programs including my own build of dwm and my build of dwm blocks what all you need to do is just get clone these on any linux distribution run a sudo make install and you've got my builds of this thing those of you that are on arch or an arch based linux distribution it's even easier than that because i have these packaged up in the a u r the arch user repository so you can install them using yay so if i go over here to the desktop and let me launch a terminal here and this is the st terminal here and in my build of st i use control shift j and k for zooming in and out and what i want to do is just show you guys yay space dash capital s and then let's install some stuff how about dwm dash distro tube dash get and then dwm blocks dash distro tube let me just do a tab complete there dash get and then if you want my build of st which you probably do st dash distro tube dash get and you probably also want my d menu d menu dash distro tube dash get and if you want the colorful shell scripts that appear at random in my terminal make sure you grab shell dash color dash scripts let's install those and i'm kind of curious to see if they all build correctly i've actually haven't installed some of them in a while as far as from the a u r now one of the things that makes the emoji support and the the unicode glyph support work is i have a hard dependency for dwm and dwm blocks for libxft bg r a that is a a u r package and that is what you need to install to make sure that you get the support for the glyphs that you need i didn't type my password correctly all right and it looks like all five or six of those programs actually installed correctly so let me close that terminal and i actually logged into my version of dwm so this is my dwm and this is my dwm blocks here uh my st terminal and of course we got the random shell color scripts uh that's very easy to get that up and running i do super shift enter here is my d menu that's got some kind of cool colorations and patches and everything so that is an easy way for you guys to get up and running with dwm and dwm blocks now if you use my dwm you will find the configuration files for all of my suckless builds if you installed them through the a u r you will find them in the slash opt directory so cd into slash opt by doing ls you see have all of those programs that's where they store their source code after installation so if i cd into dwm blocks dash distro tube dash get doing ls you will see there's the config file blocks dot def dot h let's do vim and you see there it is it is setting these icons which are just unicode characters and then it's running these commands which are shell scripts that are in the dwm blocks directory that's in the slash opt directory and they're updating however many seconds i felt like they needed to update like the the script here which just tells me what the kernel version is i don't need that to run every second right every 360 seconds is perfectly fine same thing with the pack update this just tells me how many updates are available on my system right now only two updates are available so i've done a recent update uh other things i have i have the uptime i have uh how much ram is being used versus how much ram is available on the system i also have my current volume percentage and the date and time so if you wanted to edit this you just edit this to whatever it is you want and then do a you know write and quit out of vim you're going to need root privileges of course since this is in the slash opt directory so you'd have to do sudo name of editor name a file then after all that's done in this directory run a sudo make install boom you're done now before i go i want to thank a few special people i want to thank the producers of the show devon fran gabe corbinian michael lakami r6530 chris chuck donnie dylan greggory lewis paul pic dm scott and willy they are the producers of the show they are my highest tier patrons over on patreon without these guys this quick look at dwm blocks would not have been possible the show is also brought to you by each and every one of these ladies and gentlemen as well all these names you're seeing on the screen these are all my supporters over on patreon because this channel would not be possible without you guys the community if you'd like to support my work look for distro tube over on patreon all right guys peace