Files

385 lines
27 KiB
Plaintext
Raw Permalink Normal View History

Episode: 3274
Title: HPR3274: My Custom dwm Setup
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr3274/hpr3274.mp3
Transcribed: 2025-10-24 20:01:47
---
This is Haka Public Radio episode 3,274 for Thursday 18th of February 2021.
Today's show is entitled MyCustomDWM Setup.
It is hosted by AFAB and is about 36 minutes long and carries an explicit flag.
The summer is me talking about how I customized DWM and it and removed patches and written various crypts.
This episode of HBR is brought to you by an Honesthost.com.
Get 15% discount on all shared hosting with the offer code HBR15. That's HBR15.
Better web hosting that's Honest and Fair at An Honesthost.com.
Hi everyone, welcome to this video. In fact, this is not just a video.
I am really recording this as an episode for a podcast on HBR Haka Public Radio.
But alongside that, I am making a video at the same time where I will show on my screen the things I'm talking about.
And this video is available on YouTube.
There will be a link for that in the show notes if you're listening to the audio.
And similarly, once this goes up on HBR, I'll put a link to that in the description of the video on YouTube.
So today, I'm going to talk to you about this desktop environment.
This is my custom version, I suppose you could say, of DWM from suckless.org.
It's featuring my status bar, which I'm going to talk about in a little bit.
In fact, I've got a little list of things I'm going to talk about right here.
So let's go from the beginning.
I should introduce myself as the standard practice on HBR online in the last 20 or so years.
I've been known mostly as RFAB, ARFAB, that is also my Twitter handle at RFAB.
If you see me in IRC chatting about Linux and stuff, then that's going to be the same thing I use there.
I may also be known as Clear Night Sky, which is the CLEAR NITE SKY.
That is the account name I use on GitHub, just because that's the way it is.
My oldest existing email address is actually Clear Night Sky at Yahoo.co.uk.
And so that's why I still use that name occasionally.
And in my other sort of professional work as a musician, I may be known as Trumpet Planet.
So there's a Twitter account that goes along with that.
My main website that I used for my work, which is now just a blog, in fact, goes by that same name, Trumpet Planet.
On the subject of this desktop stuff, there's actually a video or two that already exists of me describing the workflow I use for writing music using.
The program, Fresca Boldi, which is just a front end for Lillipond, which basically is kind of like a markup language for music.
I really enjoyed learning that earlier this year, which I'll get onto in a short while.
So coming back to HBR, I did actually have an episode on HBR, which I discovered was episode 618,
me talking about installing Windows XP in Virtual Box.
I don't know if this here says when that was recorded.
I was quite proud of myself for using curl to download the RSS feed and then gripping for my name.
No, there's no mention of date there, but 618 long time ago, I reckon it was probably 2010, maybe, or around then.
Let's close this one.
Okay, so let's come back to my little list of things to send.
Okay, so this is let's get into the content of the podcast now.
So, you know, I've been a Linux user since about 2003.
Yeah, that's got to be right. It would have been August 2003, a friend of mine stuck Slackware 9 onto my desktop computer.
And I went back to university with this computer. I had no idea how to use.
I can remember one of the first things I did was I wrote, I did some, so I wrote an essay in a text editor, probably VIM,
and saved it on a floppy disk, but I didn't know how to unmount floppy disks.
And so, I actually took this disk into college with me all private.
I was going to print off my work and then I got there and there was nothing on it.
Anyway, yeah, so I started off with Slackware. I was always really attracted to the minimalist desktops.
You know, I've used KDE and XFC, I've used and modified them all a lot,
or at least I've spent many, many hours customizing the look and feel of these things.
I was always more driven to use things like flux box, even black box,
because especially with my current opinions about computing,
you know, I can't really see much advantage to using flux box over black box.
But either way, I think that they, I find them a little irritating with this whole dragging window around business.
I find it almost ironic that, you know, we have all of these window managers for Unix and Linux systems,
and actually one of the things that they don't actually do is manage window placement.
You have to manually do it yourself.
And that's what one of the things that's really drawn me to using Tyling Window Managers,
and at this point specifically, DWM.
So yeah, I've got a whole folder of these screenshots of various desktops that I've used over the years,
and it's really funny looking back.
You can see that I was always attracted to, you know, window managers that didn't have borders,
and that sort of thing, because I think that really, I like to think about what it is we need to be seeing at any given point
when we're trying to complete a task, and a lot of the time there's information on the screen that is not,
it is just distracting, and it's wasting screen real estate is, you know, something that we want a term we could use.
Anyway, I'll try not to make this four hours long, so let's get moving.
A couple years ago, I found Luke Smith's YouTube channel.
At the time he was sharing this project of his, that he calls Lives.
I think it's Luke's auto-rising something script, and it was based around I3.
And I started using this, and really found that I enjoyed the Tyling Window Manager when it was set up nicely.
Okay, so I'm just going to do a little edit here.
I got distracted with pushing buttons, and we really started talking nonsense for a few minutes.
So all I'm going to do is say I really enjoyed using I3 with Luke's setup, but I found that I was customizing so much of it that I eventually just started again by myself.
And when he moved over to DWM, which wasn't long after this, I decided to do the same.
But I've not really used his version of Lives with DWM much at all.
The word I couldn't remember before, for those interested, was bootstrapping.
So it's Luke's auto-rising bootstrapping script.
That still sounds wrong.
Okay, never mind.
So I'll just going to talk you through the interface here very quickly.
There's not a lot to say.
Windows tend to tile like this.
So you have your main window on one side, and then subsequent windows will come on the stack on this side.
I've got a keyboard shortcut for inserting and removing the gaps between the windows.
But like I said before, this may say in the future, depending on which edit this is.
This is purely aesthetic, and actually really lovely for screenshots, but not very practical if you're trying to use the full screen.
I really actually quite like to use it like this, where it just looks like a terminal.
It's almost like text mode.
You wouldn't know that you're in X until you try to open something.
So anyway, let's come back.
Let's just talk about what you can see at the moment along the top.
I've got seven tags set up with DWM.
The first six of which are just standard tags.
Let's say if I was to open a terminal, put it on tag three.
I could then bring it into view like this.
So if I were reading a book and typing a script at the same time, I can pull that in and take it away in and out of view by adding the tags.
You're the keyboard shortcut, but I don't see the purpose in having nine tags.
So because I'm constantly trying to optimize my workflow, I tend to think that if I have more than six tags in use, I'm doing too much at once.
It means that everything's gone mental, I'm unfocused and not achieving anything.
I've tried to minimize it down to four.
Actually, that's not very realistic because it doesn't take long to fill four tags.
I don't like to have three terminals on tag one.
Then when you try to pull one of them into view, you get the lot.
It's a mess.
Six seems to work.
I don't tend to run out of tags that way.
I've then got this waste basket, which is actually just set up on the keyboard shortcut for tag nine.
If I was to switch to that now, you can see that this is actually just the controls for GUVC view, which is what's putting that little pretty face of mine on the screen.
But the thing, this is the thing. I want the picture. I don't want the control panel.
So I just dump that up onto tag nine in the waste basket.
It's kind of like, you know, iconifying or minimizing a window.
It's just putting it out the way.
So yeah, that's what I do.
This is another, I used to use a patch for DWM, which is window, sorry, terminal swallowing.
So if you open a program in a terminal, then the program will occupy the same space that the terminal did.
And when you close it, you go back to the terminal.
But I just actually find that I sometimes, especially using MPV and such things that I want to be able to view the output in the terminal.
That's one of the advantages of opening programs that way.
So again, I just dump things on tag nine terminals that are running programs and whatnot.
So that's that.
Okay, so here you'll see I've got a little alien head.
What I've done is I've just basically changed the layouts, the various layouts that are available.
So standard tiling view is an alien's head.
If you click on it, then that's going to give you ghosts, ghosts float.
So that's just now floating, floating mode, like this, more traditional sort of way.
So I can click back.
And there's a keyboard shortcut for doing this as well.
So, you know, that's that's what and what that is.
I do not see the point in monical view.
That's just something that I can't get my head around.
I do have it set up.
But there's no keyboard shortcut for it and it's a magnifying glass icon.
If I select a single tag and then it's and have nothing else on it, then that's the same as monical.
So why have two settings for it?
You know, I can turn the bar off now with full screen.
So there's just no purpose to having having all that stuff.
I am really pro removal of features.
And I think once this little bit that I'm now editing in from the future is over.
I'm talking about that stuff a little bit later on and maybe not being so clear about it as I am now.
I think really the only other thing worth mentioning to do with in terms of how things look,
what you're seeing on the screen is that, you know,
these various things are enclosed in square brackets.
And I decided to carry that over into my status script, which I'll describe later on.
So that it's just a uniform view.
But like I do go on to say, I'm quite tempted to just go down to having nothing more than the clock in the status bar at the top there.
Because I've got another thing that uses DUNST,
the notification demon program thing, notification program thing.
God, I just said it again.
Right, that's the end of this little interjection.
And I'm going to take you back to me in the past, continuing on from where I was up to in my little script.
A story. So obviously 2020 came along and the pandemic had us in the UK and in lockdown.
And during that time I started to learn to do some programming in Python and JavaScript.
I think I got quite a lot out of learning that stuff and I haven't quite finished one of the courses I was on actually.
But what I have found difficult with learning Python is that I don't really have any projects that I wish to use it for.
It's a little bit of a redundant skill at the moment.
I have done some projects in the summer.
Things like stripping the database from my online ebooks store and creating a mailing list from the customers.
I did that in Python and I recently realised it would have been much quicker to do it using AUK.
But we live and learn.
And I think I was using a lot of my new skills.
So I was quite happy with that program at that time.
I wrote a GUI for sending emails using Python.
But again, pretty pointless.
It was just a project to sort of demonstrate what I could do.
I wrote a website in HTML and CSS.
Because I kind of like this.
I'm not nostalgic about the old days of the internet and trying to get away from using social media as much as possible.
It's sort of a sort of virtual flag in the ground to have an old school website that just says,
My name is Rich. I like computers.
And this is what I do with my time and all this sort of stuff.
In fact, I'm just going to bring that one up on the screen now.
And you use the surf web browser.
Another subtlest thing.
I don't use this all the time because actually it's a little bit buggy on my setup for some reason.
But anyway, if we just go...
The web address is RICHCOLQ.XYZ.
So this is that site and a bit of a beard when I took that photo.
What you'll see here is there's a page called desktop.
And it kind of talks through ideas I was having about desktop paradigms and demonstrates some pretty old screenshots of early versions of this setup that I'm currently using.
Oh yeah.
See, that status bar is quite different.
And it talks through things.
But actually, the way things are right now are much a little bit more up to date.
And I'm going to talk about those sort of design decisions that I've made over time.
In this first version, you can see there's actually a list of different patches that I was using.
So, you know, the gaps between windows is an aesthetic thing.
I had this clever little patch called fake full screen so that you could play YouTube videos and the like in a sort of maximise but within the confines of a window.
But then I had to have another patch that meant that you could still do proper full screen.
And it just seemed like a lot of messing around for a pointless feature.
The funny thing is that over time I've come to remove almost all of the patches that I have had for DWM.
And I think that maybe in future I will share this work without distributing my build of DWM at all.
Because I think something I've come to learn over the time is that actually the thing of value to me in this custom version of this desktop environment that I've sort of been evolving over the last nine months is that the keyboard shortcuts and the status bar and stuff like that.
None of which is actually really a part of DWM other than changing the config header file which has the keyboard shortcuts in it.
But anyway, let's come back to my little script.
So yeah, anyway, that's the website richcog.xyz and you'll find a link on the desktop part of that to my GitHub which like I said before is under the name clear night sky.
So let's have a talk about what programs I'm using in this environment.
Obviously DWM, you can see that that's what's happening here.
The patches that are currently installed are only full gaps which again is for if I this has got more than one thing on the screen.
It's for doing this kind of business, you know, for putting the gaps between windows.
I go back and forth liking and disliking this feature. I've got it turned off by default.
I've got keyboard shortcuts to turn it back on.
You know, it looks nice. It's great for screenshots but it's a waste of space.
It's a waste of screen real estate in the same way that title bars would be in a tiling window manager and even to a degree the bar along the top is not necessary most of the time.
So yeah, I have that one. Similar thing with the with having a border around windows. I currently got it set to one pixel of a very dark grey.
Just because then if I have multiple multiple terminals open but with with the gaps turned off you can still see where each terminal is contained.
I found it really strange when I had no border at all that when you had two terminals next to each other they kind of just merged together in the middle and I didn't like that.
I just closed something unintentionally. Let's not worry about it.
So going alongside with DWM I have compiled my own version of D menu. It's patched pretty minimally.
If you look up in the top top right of the screen you'll see that there is the numbers patch which means that say if I was to start typing.
In the word I used brave there you can see the number of items in the list is decreasing from five thousand to now forty three.
By the time it's BRA there were only four you know that that string is only present in four executables and so on and so on.
It doesn't really do anything.
Again maybe I'll take that patch out. It's so funny how actually I constantly think to myself that you know these features that I thought were important in the beginning just don't do anything.
There's no need and so I'm coming more and more back to vanilla builds of almost everything.
I've got my own build of ST for terminal not 100% happy with it yet. I'm still messing around trying to fix the backspace key.
I know there's a patch for that but some reason I'm reading the man file wrong and it's not working out.
But it's got this nice I think it's called dark killer theme or something like that.
Yeah but you know it's a minimalist terminal and it looks nice that's really all that's really all I need from the terminal.
I think I patched it so that let's go to another tag that's open if I was to open PS or something.
If you hold down shift you can use the mouse wheel to scroll up and down in this.
That's probably one of the first times I've actually needed to use the mouse in this whole demonstration explanation.
This is something that's actually really a big part of the desktop build is the simple X hotkey demon.
If I was to just pull up the context script here.
You can see I'm not going to talk through all of the keyboard shortcuts because that would be insanity.
Especially if you're listening to the audio version that is going to be incredibly boring.
But if I just pull it up you can see I've got everything sort of categorized.
So if you do alt and shift it's going to open up things that are relating to system configuration.
For example alt shift A is going to bring up the controls for pulse audio.
Same with W is going to bring up an MTUI network manager.
And such things like that.
So I've got things like screenshots and the Luxemist D menu Unicode copyer,
which is I use quite a bit because you can see the icons along the top here.
They're all the motocons.
I'll just show you.
So what it does opens D menu with a long list of emotocons.
And you can select something at copies to the clipboard.
And then you can paste it.
Let's say like this.
No, they say that's clever, it doesn't work.
What am I doing?
Well, that's not worrying within your keys.
But yeah, so that's a useful thing.
Then I've got sort of programs that I use all the time.
So web browser, Trent, the TREMC, the front end for transmission demon,
simple note, fresco bolde, Ranger, which I'm learning to use at the moment for my fire manager.
Honestly, my fire manager is bash.
I use a terminal for fire management 90% of the time, if not more.
I've really moved away from most things that involve icons.
Any kind of point and click stuff is kind of pointless in this environment.
And actually the trackpad on this computer isn't very good.
So that's a good thing to be getting away from using it.
What I would do want to show you, there's a line here.
Alt S brings up my status notification.
So it uses DUNST.
DUNST I haven't got to mentioning yet on the list of programs I use, but that's.
What that's doing is that's reading out the contents of a bunch of status files.
In fact, I seem to be, let's just make sure I'm not getting ahead of myself here.
And I'm going to do this bit now.
So if you look along the top of the screen on the video,
you'll see the contained within the square brackets are a bunch of icons, which are emoticons.
There are only four things on this status bar, but by the clock and date.
They are an icon that shows this changes between three options depending on if it is.
If you're on Wi-Fi, if you are connected to local network, or if you are connected to,
if you're not connected to a network at all.
Let me show you the script for that, because you'll get an idea.
I'm not going to do this for all of the scripts, but I'll just show you how this one works
because it generally demonstrates what it's all about.
I think the way I do this is probably quite similar to what people do with DWM blocks.
I don't use that myself at the moment.
I've got it through automatically updates, and I've got a script that kills and reloads
when certain things are done like volume.
You can see that that's turning the volume up and down.
And I've got three, four different icons that show how that's working.
The mute works in the same way.
When I'm doing that, all it's doing is actually reading out the contents of this dot status.
What's in its sound?
And you can see that that's there on the command line.
It works in the same way.
So let's have a look at this script for the network.
I think it's called NetStatus.
Yeah, there we go.
So all you can see is this is a batch script.
First of all, it reads two files in the slash slash slash slash like I can't talk.
Slash cis slash class net operating state for the various devices.
It determines the IP address and then uses org and cut to grab the information we need.
And it echoes the results of that of that into that dot status slash network text file.
And then in my DWM script, sorry, status script, which is another thing I wrote.
And this must be like on its fourth iteration at this point.
You can see that it's just it then uses org to for the status bar.
It just grabs the icon, but it doesn't grab the text.
I could change that at any point.
So it's easy to get lots of different setups for the status bar just by editing this folder.
Just by editing those, those all lines.
But when I do Alt S, it brings up the entire contents of all those files, including the keyboard layout network, sound power date and time.
And so again, if I was to turn the bar off at the top, I can just see everything I need with a key press.
And I don't have to re-lock open the bar.
That's just a key press as well, but it's just one of those things.
I did spend some time contemplating whether we need the bar at all.
I think it's more like a safety blanket really.
It's just showing you which tags have got things on them.
And the time.
But all the other information is available through other means.
And something I've thought about quite a bit as well is where your eyes go when you're using a computer.
Because I find that if the bar goes along the top, then I'm constantly looking at it.
But if it goes along the bottom, I forget that it's there.
If I'm sat at a desk with a monitor, it's the other way round.
I find that having a bar along the bottom is always in my line of sight.
Having a bar along the top kind of disappears in my peripherals.
So that's an interesting thing, depending on the form factors of your device.
And I was thinking of doing a patch for DWM for moving the bar up and down with a key press.
It seems a little bit.
It will probably be another feature that I deem unnecessary at some point.
So we'll be leaving that one out for now.
But anyway, so my DWM status script basically just...
It runs all of my power check, same check, net status scripts.
Which pull all that information out of the SIS folders.
Dumps the information into this dot status folder in my home directory.
And then uses Excel Root to put that information formatted onto the status bar.
And then it waits for 10 seconds.
There's a little until loop where it uses date and cut to double check.
So I think it updates every 10 seconds.
Because that way the clock is going to be accurate.
It resets when the seconds is zero.
So that's going to be at 0 seconds, 10 seconds, 20, 30, and so on.
Otherwise, yeah, I mean, if the clock just updated once a minute,
then depending on what time you turn the computer on,
it could be off by as much as 59 seconds.
That would really annoy me.
Anyway, right, let's come back to my script.
I'm going to be boring you.
I think we're pretty much there with this little talk about all about what I thought about when creating this desktop environment.
I said where you can find it, go look at the website, have a look at all the scripts are available on GitHub.
Really, this project is a little more than me exploring how I use a computer,
how I want to be using it, what I want to be able to see on the screen at any given time.
And also, it's me learning to use bash scripting and new tools that are new to me that probably existed since the 70s and 80s,
like Grep said, Ork cut, all this sort of unix command line stuff.
I'm really enjoying sort of knowing more about that,
because like I said, I've been using Linux for 15 years,
more than 15, 16, 17 years.
And for me, for a long time, you know, using it,
it meant little more than actually, I was purely an end user.
I wasn't really getting in deep and understanding how stuff worked, you know, meaning for way.
And so yeah, just take a look at the stuff on GitHub.
By all means, install it and you're welcome to write to me and talk about other ideas relating to this moving forward.
But I think that really, I'm currently quite happy with being able to write little scripts,
things like something I did the other day was this keyboard layout switcher.
You know, this computer is a US keyboard.
But when I do my account, I need to have the pound symbol.
And by that, I mean the financial pound symbol, not the hash key.
And that doesn't exist here.
So I wrote this little script, which I think is on that.
Yes, so it uses D menu.
You type in the keyboard layout you want.
Let's say we'll switch it to the Spanish layout ES.
And then you get a little dunt notification over here, keyboard layout change.
There's a flag, espagnol.
And then in that dot status folder, there will be a file that's telling you the keyboard layout.
And you can see it's changed up here on the status bar at night.
For some reason, the status bar refuses to use the same icon set as dunced for the emoticons.
And so you'll see when I pull up the status thing there again,
there's a little discrepancy between all the icons are very slightly different.
It's a different font.
But I'll get to the bottom of that at some point.
Good.
In the interest of not talking forever about nothing,
I'll leave this one here.
Thanks for listening.
And I'll speak to you all again soon.
You've been listening to Hacker Public Radio at HackerPublicRadio.org.
We are a community podcast network that releases shows every weekday, Monday through Friday.
Today's show, like all our shows, was contributed by an HPR listener like yourself.
If you ever thought of recording a podcast, then click on our contributing to find out how easy it really is.
Hacker Public Radio was founded by the digital dog pound and the Infonomicon Computer Club.
And it's part of the binary revolution at binrev.com.
If you have comments on today's show, please email the host directly.
Leave a comment on the website or record a follow-up episode yourself.
Unless otherwise stated, today's show is released on the creative comments,
attribution, share a light, 3.0 license.