 A common support question that I sometimes receive on my GitLab and through other media is how can I switch out Dmenu for Rofi or vice versa and some of these scripts that people share online. So many people write Dmenu scripts, for example. I have a package called DM scripts on my GitLab. It's a program, it's a collection of about 26 or 28 different Dmenu scripts that you can install on your system. I believe it's available in the AUR, the Arts User Repository. For those of you using the DTOS repositories, you can install DM scripts via Pacman. But DM scripts, my package, it actually expects you to have Dmenu installed on your system. And of course, many people write Dmenu scripts. Dmenu scripts are just littered all over GitHub and GitLab. And of course, many people write Rofi-specific scripts as well, you know, scripts that expect you to be using Rofi as your run launcher. But you can actually switch out these run launchers. You can use Rofi in a Dmenu script and you can use Dmenu in a Rofi script. They're actually pretty easy to interchange and you don't need any programming experience. You don't need any scripting experience. You really don't need to know any bash at all for what I'm about to do. So this is very simple for those of you that have had this problem. Let me switch over to my desktop here. I'm going to open my browser and open the Brave browser here and let me open a tab. I'm going to do a quick Google search here for, I don't know, Dmenu script. Let's just search for a random script on GitHub. Here's a collection of Dmenu scripts. Let's find one and let's make it work with Rofi. So let me zoom in here in the browser so you guys can see. This script here is very simple. The first three lines here that are not commented. These are assigning some variables here, lines, dash L20. So this is how many lines Dmenu is going to use font. This is the font that Dmenu is going to use and colors. These are background color, the foreground color, et cetera, that Dmenu is going to use. These are typically flags you use in the Dmenu command. He's just shortening them to these variables here. But I don't want to get too technical because I told you, you don't need to know any scripting or programming. You actually didn't need to know what those lines do. All you needed to know that there is this line here, Dmenu. Now if you replace that with Rofi space dash Dmenu because Rofi has a Dmenu mode, this Dmenu script would actually work with Rofi. Let me actually copy this. I'm going to close the browser, let me CD into a test directory that I have. And I've actually already copied that particular script over into NeoVim here. So right now I'm just going to leave this script as is. Let me write and quit and let me chmod. I'm going to do a chmod plus x on that file, meaning make it executable. So I can actually run it because if you don't make it executable, you can't run the script. And now I'm going to do a dot slash name of script. And there is vet in Dmenu, right? So that is just Dmenu running at the top there and let me kill that. Now what if instead of doing all of that, I go back into the script and again, you don't really need to know any programming. Just go find wherever the script pipes things into Dmenu. There's two places it does that. And all you need to do is change Dmenu into Rofi space dash Dmenu. And then down here, Rofi space dash Dmenu. Every instance where you see something being piped into Dmenu, the Dmenu command change it to Rofi space dash Dmenu. And now let me rerun that. And now it's running that same script, which is a kill process script is showing all the running processes on my system. And I could go pick one and kill it if I wanted that process to terminate. So how easy was that? You didn't really need to know any batch scripting to figure that out. And you can pretty much do that with any script that was written with Dmenu in mind, just replace it with Rofi space dash Dmenu. So let me go back into this script here. And one thing I would say is what I would advise people to do is instead of having Rofi or Dmenu in your script, what I would do is set a variable. So in my DM scripts, what I actually do is I have a variable for Dmenu equals and then I have whatever command that I want the run launcher to actually run such as Dmenu dash L20 for number of lines is 20 dash I for insensitive name searching. So that's the way I would do it. I would set that variable and then I would go down here and just have the commands that are being piped into Dmenu or Rofi. Just be a variable. So now that I have that, let me write and quit. I rerun that. Of course it's running it in Dmenu, but what I could do is I could always change that. What I'm going to do is I'm just going to copy the line and this time I'm just going to go in here and I'm going to change that to Rofi space dash Dmenu. And of course, we can't have both of these active, so I'm going to comment out the Dmenu line of the Dmenu equals Dmenu. I'm going to have it now. Dmenu equals Rofi space dash Dmenu. And now, of course, the script executes in Rofi. So those of you writing Dmenu scripts or Rofi scripts, what I would strongly urge you do is to use a variable for the run launcher and have both lines. Have a line for that variable to equal Dmenu, have a line for that variable also to equal Rofi so people can swap between the two very easily. People that know nothing about scripting can't easily turn on and off the run launcher that they want to use. So that is what I typically do in my script. So that's what I do in my DM scripts. Let me open up Emacs and I will navigate to my DM scripts here. So if I go into my home directory, I look for my DM scripts repository here. Let's open this up in Dear Ed here. Of course, DM scripts, this is typically what the source code will look like. I go in the scripts directory. There's about, again, about 26, 28, nearly 30 scripts in this directory. These are the actual scripts themselves. But you notice I also have a config directory. Go in it and there is a single file called config. And if I go into that, this config file, this is a config file for all of my DM scripts. And you see this line here. Demenu equals and then demenu with all the appropriate flags. Well, if you wanted to, what you could do, copy that or comment that out and then now change that variable to demenu equals rophe-demenu whatever flags you want to use. And that would be all you have to do. Now I'm actually not going to do that because this is a Git repository so I actually didn't want to change that file. But if I did that, all of my DM scripts, if I launch my DM scripts, would now of course work using rophe. And actually, now that I think about it, for documentation purposes, I probably actually should keep a line here. By default, it should, of course, default to using demenu. That's probably what most people that install DM scripts will expect to be there. But I will leave this commented line out for rophe for those that want to be able to swap between the two. There's a train going by. You guys can probably hear the train horn blowing there. Well, yeah, I will ride and quit that and I'll commit that to the next version of DM scripts. And for those that want to learn more a little bit about some of the documentation on how to use demenu and rophe, of course, check out the man pages. There's a man page for demenu, of course, that'll give you all the flags. And of course, if you read the man page for rophe and look for demenu, you will see emulating demenu. So that demenu mode and you can see there is actually a man page specifically for rophe-demenu. And that's all one word for the man page. So rophe-demenu will actually tell you a little bit about how rophe can emulate demenu, how you can swap out rophe and demenu in a script very easily. So I hope that helps people because it is, again, a very common support question because I write so many scripts of mine with demenu in mind and so many viewers of the channel. You guys, so many of you guys are using rophe and you want me to rewrite these scripts to use rophe. I'm not going to do that because then the people that would want the script to work with demenu would complain, right? Because no, swapping them out is as easy as swapping out the demenu command for the rophe command inside the script. And the person that wrote the script did it in a smart way. They probably have a variable like I do in my DM scripts where there's a variable for the exact run launcher you're using. And if you swap that out, it changes all the instances of that run launcher in the script for you. So you don't have to manually change, I don't know, five, ten instances of demenu for a rophe. If it's a very complicated script. Now, before I go, I need to thank a few special people. I need to thank the producers of this episode. And of course, I'm talking about James Maxim Matt Mimit, Mitchell Paul, Royal West, Armor Dragon, Bash Potato, Chuck Commander, Henry George, Lee, Methos, Nate, Erion, Peace March and Vador, Polytech Reality, S4less, Red Prophet, Roland, Stools, Devler, and Willie, these guys. They're my high-steered patrons over on Patreon. Without these guys, this episode would not have been possible. The show is also brought to you by each and every one of these fine ladies and gentlemen. All these names you're seeing on the screen right now, these are all my supporters over on Patreon. I don't have any corporate sponsors. If you want to see more videos about free and open source software like Demenu and Rophe, subscribe to DistroTube over on Patreon. These guys.