 Alright yo yo everyone here we are back again I know it's been a while it's been like I don't know a month since I've been doing basic videos but yeah I've just been super busy but now it's time to get back in the saddle and in this video I'm gonna talk about D menu which is a program that probably a lot of you have heard about but the people never use it how it's really intended to in fact I didn't really use it how it's really intended to be used until really a couple days ago I started actually actually experimenting with it so I'm gonna talk about how to use this thing actually let me let me show you the basic usage that everyone knows about so D menu it's one of these suckless utilities as you may know and in its most basic form a lot of people use it as an application launcher so if you use the command D menu underscore run which I have mapped to mod D you will get a nice little application launcher and let's say I want to open up Firefox type that in here it comes so that's usually how people know D menu they just think of it as being an application launcher but it's actually a more general and highly customizable sort of menu selection I I don't know it's just we'll just get into it we'll get into the kind of stuff you can do with it so just as an example I have this little file here oh and by the way I'll talk about this later notice that mine is a little different from the default I just changed the colors if you know how to change suckless utilities you do it in the configs but I'll talk about that at the end of the video just so you know but if you install it and if you install the default binary it's gonna look a little different don't freak out about that anyway so I have this little file here I've called it colors it has a couple colors in it red blue green yellow purple actually let me pull up a window here so we have the file colors now how D menu works by default is you can pipe in a bunch of different lines into D menu and it's gonna give you basically those options that you can choose from so I can type in red I can type in yellow you can type in erp instead of purple you don't have to start at the beginning you can just type some subs sub part of it or if you don't start typing anything and just press enter it'll just pick the first one or if you press escape it's you know not gonna choose anything that's that's the basics of it now notice when you select successfully choose something it's gonna return that value this is you know the power of D menu it's really just you can write a script that decides what descended and decides what to do with each of those options so let me show you some of the ways that I've implemented this again I've just really just been playing with this for a day or so but these are the kind of things that I've been working on so first off just a little script this is just like one line but this is something pretty useful now one problem that I often have is or I used to have was in my i3 config I have a couple shortcuts here let me maximize this I have a couple shortcuts like mod shift x I've always used to shut down my computer but that was a problem because originally I didn't have any way like it just shut it down without asking what to do or anything and mod shift ask x it's not the kind of thing that you'll be pressing often you're not I think I accidentally pressed it once but it's not a huge deal but I wanted an extra layer of security regardless so what I did here is I made this little script prompt which you can see that it's now where is it yeah so it's now running so and how the script prompt works is you give it one its first argument is going to be the prompt that shows up in D menu and the second option is going to be the command that it runs and I defined this earlier in this document but it's you know pseudo shut down whatever shut down now whatever it is so anyway how this little script prompt works is literally we just echo so we'll do part of it manually so we'll echo in no and yes to D menu and so now we're gonna have the options known yes we can select one of them or something the I is for case sensitivity so that means I don't care if it's lower case it doesn't matter and the P here is for the prompt so if I say something like you know are you sure it'll say are you sure here so again all all the script does is the first argument is just what prompt you want and the second argument is if that prompt if you select yes that's the command you're gonna run so how this works is now if I press mod shift x which is my shutdown command it's gonna ask me are you sure you want to shut down it's not gonna automatically shut down and if I press if I type in no or if I just type in nothing or anything that's not yes it is going to and it's not gonna do anything same thing I have a reboot command I have a shut down I3 shortcut all of these you know now they don't do it automatically they wait for confirmation in D menu which is very very nice so that's a little little tiny optimization so I have some other things as well another thing that I like being able to select manually is what display I use so I have another little script here this is for if you connect your computer to a VGA HDMI or something like that now originally I did it in a sort of call I mean it worked but it was sort of unencumbering because basically I had I had something like if I want to go to VGA I mapped like F mod F10 to use the VGA only or mod F11 to use HDMI I don't even remember what it is but now I have those all in one D menu menu so I have this whole script to map to mod F3 and that gives me a couple options laptop dual display laptop VGA HDMI or manual slot I'm not gonna select any actually I can select manual selection manual selection just brings up a render any of the other ones are just going to automatically run a particular X render command that uses only that screen or whatever configuration I say so I can pretty much add in different options here and D menu allows me to you know choosing off I want HDMI or whatever I'm not gonna actually select them because that'll mess up the recording but oh and also if you're a poly bar user I have I have to get poly bar to restart so I just have it restart after all these you know just you don't have to do that if you don't have poly bar it's just if you change screens poly bar needs to know where to respond so I have a launch script that launches it on every available display okay so that's that so that's another thing and the other little script that I think is might give you some ideas is let me open up my RSS reader here so oh which I realize I haven't actually done a video on news boat which I'm meaning to maybe I'll do that today or tomorrow or something like that but here's my RSS reader and I'm gonna go to let's go to Chris Akapinti's channel it's got a bunch of shell script tutorials right now so I have a bunch of commands mapped well okay usually in newsboat if you're a newsboat reader you know that you can select you can you know add a bunch of external commands to basically select whatever link is at stake in this RSS feed and open it in whatever program you want now I wanted I do have that but I want to be able to manually select which program I use to open this stuff up sometimes so I have comma P mapped to this D menu command which has how should I open this link and I'm gonna say I don't know MPV or something like that and I just have different choices for the kind of things I usually run on having you know on these different RSS feed links or something like that now let me show you that script that is D menu handler I'm just arbitrarily naming these things and again it's the same idea this is just for shortening the link if it's too long visually this just has different options run an MPV run an MPV on loop sometimes I want to run GIFs in that have a floating MPV you know open and fair or your browser or something like that so anyway that that's pretty much it so hopefully these have given you ideas for the kind of stuff you can do with D menu I will say I think I mentioned before I have my own custom configuration of D menu now if you want to have I like having these colors because I think they go a little better with my configuration now like most suckless utilities D menu does not have custom config files instead you compile D menu with whatever settings you want now you're not going to be able to do that with the addition in your you know whatever your repos are your arch repos or Ubuntu repos or something like that so what you have to do is go to suckless.org why is my computer lagging so bad it's probably because I'm using the new Firefox but whatever so go to suckless.org and I think it's tools yeah and you just have to download the source code manually D menu and you can go into the config you can go into the config file here config.config.def or config.h takes presidents and you can select what kind of colors you want I have my size a little bigger just because by default D menu is pretty small and it doesn't actually cover up all of my poly bar which I want to I don't originally like you could see part of it which was sort of annoying so I just make some little tiny tweaks there just to make it a little bit more usable but anyway that's about it so D menu as I said like I only just got into this stuff but a couple days ago actually configuring it deeply but I definitely can consider I definitely encourage you to try and configure it yourself get whatever you want out of it just because they're you know like most suckless utilities you look at it at the beginning you're like oh this is totally useless and then you delve deeper into it and see that you can basically use it anywhere so anyway that's about it so I'll see you guys next time