Episode: 345 Title: HPR0345: Editing the auto-generated menu in Linux Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0345/hpr0345.mp3 Transcribed: 2025-10-07 16:51:52 --- So Hi, my name is Gordon Sungler, and my handle on IRC is Thistleweb. In this episode of Hacker Public Video, I'm going to talk to you about how to edit the auto-generated menu in Linux. Now it varies a little bit between which desktop environment you use or which window manager you use. Both KDE and GNOME offer easy edit options, so it's not so much applied to either of those two, but it does have its uses. When you go to XFCE or open box or a flux box or whatever, then it has more and more value to know how to do this. Now what I'm talking about as the auto-generated menu is when you install or uninstall an application, you notice that sometimes it adds its place, adds a shortcut onto the menu, and it adds into a specific place like internet browsers, Firefox or network Firefox. And it also adds the icon as well. Sometimes if you have GNOME and KDE both installed, sometimes you find an application shows when you're in GNOME, but it doesn't when you flip it to KDE or vice versa. You notice there, in both cases, you notice there, it just doesn't show in the menu. So there's also if the icon doesn't show or if the icons different, you want to customize the icon or you want it to show up in both GNOME and KDE when you switch between them. Or where I use it is the actual names of the packages that show up. Now I don't need to know, for example, that Firefox is a web browser. It's my default web browser. I know what it does. All I need that to say is Firefox. I don't need Thunderbolt to tell me it's a mail and news client. I don't need to Thunderbolt to tell me it's made by Mozilla either. I already know that. So what I do is, is basically tidy that up. I use G-Edit a lot of the time as well. And that drives me insane to see that listed as text editor. The amount of times that I've been looking for G-Edit and it's not, I can't find it and then I'll remember or that's right, that's called text editor, isn't it? So yeah, that's just where you can expose those demons. So the way to do it, essentially, and as I said, NOME and KDE both offer easy options to edit the menu, but when you step outside of those two, it gets more bit more, it's not quite as straightforward how to do it. In XFCE, you can certainly right click on the menu and edit it, but the editing has limits. There's a big section in the middle called Includes, and that's it. I mean, Includes what? I don't know what I do on the right to explain, but Includes what? It doesn't tell you how to edit that. In an LX-LX panel, as I say, I'm in CrunchBang Linux, which is open box with LX-LX panel. In here, I've got a menu and it doesn't give you any options for editing. So where it gets it from, once you know where it gets it from, and you can edit them by hand, they all draw from the same folder. They all draw from the same configuration files. So where they are, you need to be root to edit these. You can go and look at them as a normal user, but you should be able to, but you need to be root to edit them. So where they are is in Slash User, Slash Share, Slash Applications. Now if you go there, you'll see a whole list of the applications that are on your menu. They're listed, well, should be listed alphabetically. Now you'll notice in many cases the names match what they say or in the menus, but that's not where the names are actually read from. Where the names are read from, I'm going to open up Synaptic here. Synaptic Package Manager. As an example. Now in here, you've got the name equals Synaptic Package Manager. Well, I don't need to know what's a package manager. I'm well aware of what Synaptic does. All I need to see is Synaptic. So I'm going to take off the package manager part and just list it as name equals Synaptic. Now this lists all by languages as well. So make sure to change the one that applies to your language setting, you know, Spanish or French or Brazilian Portuguese or Russian or whatever. Now you've also got a category generic name which I don't bother changing. You've got a comment which is in this case comment equals install, remove and upgrade software packages. Well, I know what Synaptic does. I don't need that comment, but that's your rollover comment on your shortcuts. I tend to just leave that for the most part. It's no big deal. Scrolling down again, you've got exec equals Synaptic and that's the command that it opens. So if you need to put additional switches onto it, that's where you would do it. That's the command essentially that you would run from the command line to open that same program. You've also got icon equals Synaptic. Now if you find that your icon doesn't show up or if you've changed an icon and it doesn't, it does not pick it up, but you want to have a custom icon for something or you want to change the icon or whatever. That's where you put it in and you just put the full path to the icon and where the icons are kept are basically they're going to be in two one of two locations. They're either going to be in slash user slash share slash pix maps or they're going to be in slash user slash share slash icons slash the name of your icon set and then the slash the size slash apps or whatever it is to get them to match up. A lot of the time the icons build change automatically along with the rest of the desktop, but sometimes there's going to be the odd one or two that doesn't quite catch up or if you choose an icon set and it doesn't have an icon for a program that you use. Well that's how you change it anyway. You put your full path to the icon in there like slash user slash share slash pix maps slash Firefox icon dot png or whatever it is. So the other one is only show in equals no or only show in equals KDE. That's the how many of these these options varies from application to application. It varies from distro to distro. Some won't have the only show in there and you can add it if you want. You know some might have different options but that's that's how to change that anyway. If you find a program is is not shown up in one environment but it isn't another that's your reason and that's what you need to change. Once you save that you make your changes you rename it. I've just renamed this one to synaptic and then saved it. Now that changes the actual name itself to synaptic. I didn't change that on from the outside. I have changed it from the inside as the file is still called synaptic. In this case I've got it open its synaptic minus KDE dot desktop and I just changed it at the top to synaptic and it's changed it for it. So once that's changed it might not the the changes might not happen instantly. I found in an xfce the way to trigger the change was to have like a one of your your things that you can edit in the menu like a separator for example. Just click on that and use the arrows to move it up and then back down again to its original place. That triggers the the fact that oh there's been a change. Do you want to save it and it allows you then to hit save and as soon as you hit save it'll update the new changes to it. It's not great but that's that's my little tip for doing that. I'm in open box. I don't have these options so it's just a case of basically being patient I don't know it might be some cron settings that goes through and rescans it or if you want instant changes you can always restart open box or restart x or whatever but that's once it updates it'll then change to in this case synaptic instead of synaptic package manager. Now this again because you're changing it there it then applies if I go and put fluxbox on or joe's window manager or gnome or kre or whatever. I mean I love xfce I xfc's a fantastic environment so if I go and put xfce on it will read that same folder and it'll do the menus the way I want them to without me having to go and edit them in each in each version. I presume the only showing also applies to xfce or fluxbox or whatever you want the two that it seems to toggle between as nomen and kre. Now there's obviously a bit more to it to these these different options. I'm not even going to attempt to get into that because I don't know I only use it to edit rather than create and here depends on as I say depends on which applications some are more full than others in the desktop files, desktop configuration files. In some cases you might see double or I've got two Python files here for example I've got two synaptic ones as well one's for gtk and one's for sorry one's for gnome and one's for kde. So I'm going to leave it there and encourage you to edit your menus, clean them all up and then you can make sure you back that folder up when you swap dish rows or whatever and it'll save you editing and it'll give you a nice clean menu and how to edit them. So that's been it. I've probably handled a little bit there I'm still getting used to this so I'm going to thank you for bearing with me and until next time my name has been and well it is it continues to be Gordon Sunclar. My hand.nirc is thistleweb my email address if you want to contact me that way is thistle.webcast at googlemail.com and until next time thanks for listening goodbye thank you for listening to hack with all the radio. hpr is sponsored by tarot.net so head on over to c-a-r-o dot-n-c for all of us here