How to configure the menu in LXDE

I want to share with you this contribution from Ernesto Santana Hidalgo (from humanOS)Well, even though I'm not a LXDE user, I do know that here several of our readers like it (as well as FluxBox, OpenBox, and other minimalists LOL!)

The first thing we should know is that in LXDE there is no easy way to modify the menu system startup for which we have to go directly to the configuration files. Everything described below was done in WattOS, distribution based on Ubuntu 12.04. Let us begin:

To customize the menu we must modify the panel configuration file containing this. The file in question (for a particular user) is:

/home/{usuario-lex.europa.eu/.config/lxpanel/LXDE/panels

If we want to modify the menu that appears by default when creating a new user, we must modify, as root:

/etc/skel/.config/lxpanel/LXDE/panels

The first block we will see is Global enviroment, who contains the main features of our panel. This is mainly configuration of the panel color, transparency, size, etc.

Then we will see several blocks called Plugins. These are panel applets, such as launch icons or a menu. These blocks are composed of a field type = {type}, and a block called config containing its characteristics. But we will only focus on the plugin that interests us: menu.

By default we will find it this way:

Plugin {
type = menu
Config {
image=/usr/share/lxde/images/logout-banner-orig.png
system {
}
separator {
}
item {
command=run
}
separator {
}
item {
image=gnome-logout
command = logout
}
}
}

If we modify the default menu of the users that are created we must restart the lxpanel process. Now this line "image = / usr / share / lxde / images / logout-banner-orig.png" define the image showing menu icon. The first block that appears is system {}  which points to a system default menu containing the submenus Sound & Video, Office, Internet, Graphics, Accessories. All these elements are in / usr / share / applications format .desktop.

Create a launcher or menu item

If we want to add a launcher directly without it belonging to any submenu, we create an element with its fields as follows:

item{
name=[nombre del item](Opcional)
image=[Icono](Opcional)
command=[comando a ejecutar] //o action=[aplicación a ejecutar]
}

Create a new submenu

We can create a submenu, different from System. This will be made up of a field called name, which will contain the Submenu name and a field called image that will specify the icon. To add the launchers we use a block called item, which is the same as the block I explained before, but with the variant that instead of using a field called command it is called action. For example, if we wanted create a submenu for Wine, would be:

menu{
name=Wine
image=/usr/share/icons/Faenza/apps/scalable/wine.svg
item {
name=Configurar Wine
image=/usr/share/icons/Faenza/apps/scalable/wine-winecfg.svg
action=winecfg
}
item {
name=Desinstalar programas
image=/usr/share/icons/Faenza/apps/scalable/wine-uninstaller.svg
action=wine uninstaller
}
}

To modify the submenu system we must modify the .desktop aforementioned. Each contains a field called Category, which mentions in what category is cataloged. The LXDE menu interprets these categories as which System submenu they belong to. So if we want a certain .desktop item belongs to Accessories submenu, we just owe add that category, but in English (Accessories) and the categories that the menu takes by default are: Audio Video, Development, Educations, Ranges, Graphics, Network, Office, Settings, System, Utility.

Create a submenu within an existing one

If we want to create a submenu within these that are predefined by the system or one that we have created, for example, Wine, we modify the file lxde-applications.menu found in / etc / xdg / menus. Inside it are a series of labels. For example, the menu Educations:

http://paste.desdelinux.net/4710

If we want a submenu with a name to appear inside this experiment it would look like this:

http://paste.desdelinux.net/4711

The label refers to the category which we want to put in this case, those that belong to the IDE category will appear in the menu.

We can create a .directory for the new menu, which will have its name and photo. To include this file, we write the tag . If not created, the menu is displayed with a photo by default.

Create the .directory

Let's go to the folder / usr / share / desktop-directories. There are all .directory that are used in the menu that are nothing more than the settings of the menus or submenus to which they belong. Specifically experiment make reference to lxde-test.directory. We create a file with the same name that we specify in . Inside it we put:

[Desktop Entry]
Name= Prueba
Icon=applications-development
Type=Directory

In this way we create or modify menus and submenus in LXDE. A bit laborious but it certainly helps a lot to personalize the menu.

Clarification: in these last steps it is not necessary to restart the lxpanel process.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   w4r3d said

    Hello friend, there is a way that it comes out metallic or transparent more or less like this. http://2.bp.blogspot.com/–z-AYhAxS4A/Tke23ZdmyRI/AAAAAAAAH0g/iZpuz9v9qUo/s1600/wattos.png by silver I mean. I wear a fedora and I have not been able to give it that effect. thanks for your attention.

  2.   Hyuuga_Neji said

    Ahaha good when I saw the Gaara in the mail putting things from LXDE I had to go in…. Right now I'm in a school where a partner works so I don't have Linux (they don't even have Firefox in the image of these thin clients) but hey… to the article: I had never changed things on the menu (except for the Openbox menu when used without LXDE) despite having been in LXDE + Openbox for a long time. Thanks for the tip

  3.   Leo said

    This made me think that it would be great if in our comments, apart from exiting the browser and the OS, the DESKTOP ENVIRONMENT also appears !! It would be Great, although it would only work for Linux and we would have to edit the User Agent in some way. What do you think?

    1.    KZKG ^ Gaara said

      I already thought about this a while ago but ... hey there the question, it would be 100% manual, there would be no possibility of it being automatic as it is partly now with OS and Browser 🙂

      1.    Leo said

        Rest assured that manual will not be a problem for these guys who are used to "consolear".
        But it sure is easier to say it from this side of the world than from the administrators' side. Like showing the OS and the explorer I have not seen it on another page so the implementation here is very good.

        1.    KZKG ^ Gaara said

          This putting the distro and browser makes it a plugin, once you understand and understand how the plugin works ... adding functions is not so complex, that is, I could reprogram the plugin and tell it to show the desktop environment of the user of the comment , even if it doesn't recognize the desktop environment, it just doesn't show anything ... hehe, I think I like the idea more 😀

          I don't like PHP, it's a language that I really don't like ... but it's simple, very simple to understand and luckily someone who isn't a programmer (for example me haha) can achieve this 🙂

          1.    Leo said

            I'm already seeing the mouse of my XFCE in my comments 😀

          2.    Leo said

            And my dream came true. 😀

            1.    KZKG ^ Gaara said

              LOL!


  4.   Ivan Barra said

    Very good LXDE, a while ago we configured several eeePCs with a friend, we put Debian + LXDE on them and they worked very, very well, much better than with the Windows XP that came from the factory, in fact, they had an internal memory of 2GB, 512MB of ram and a 700mhz Celeron proce. The memory with windows XP was in Zero, but with Debian and LXDE we used only 700MB in total for a functional system, we put a 4GB class 4 SD to finish installing the office automation programs and everything else and they were 1.

    Another example that with Linux you can do more with less.

    Greetings and very good tutoring as always.

  5.   Ernesto Santana Hidalgo placeholder image said

    Thank you very much for putting my article here and thank you all for your comments

    1.    KZKG ^ Gaara said

      Thanks to you for contributing your grain of sand to the Linux world, it is something that we should all always do 🙂
      I hope to continue reading your interesting posts, welcome 😉

  6.   Emiliano said

    Hey, I came up with a crazy idea and I don't know if it can be done in this environment or in another ... Could it be possible to create several different menus? I mean one that when opening it only shows the games and another that only shows the office etc ... It would be something very practical but I don't know if it could be done haha
    don't fuck me if I said something weird xD

    1.    Emiliano said

      ahem I use linux mint what's up with the logo ehhh haha

      1.    FIXOCONN said

        configure the user agent is this site and post on the subject

  7.   FIXOCONN said

    it's cinnamon

    1.    KZKG ^ Gaara said

      Yes, Cinnamon is not going to be seen, not because I don't like it at all ... but simply because I don't have the Cinnamon logo at hand, and I need it to support it here.

      Do you know where the Cinnamon logo could be downloaded in .svg?

      As soon as you have the logo, it will appear in your comments.

  8.   f3niX said

    ?

  9.   Andrélo said

    I make this comment just to see the image of my desktop if they have it 😀

    1.    izzyvp said

      let's see if now if cinnamon comes out

      1.    izzyvp said

        Well yes 😀 I'm happy ^^, how sad my life is 🙁

  10.   erick said

    Friend, how can I make the lubuntu 12.04 lxpanel return to its default configuration. I have read out there that editing /home/user/.config/lxpanel/LXDE/panels/panel can be achieved but I have no idea

  11.   Manuel Antonio said

    Hi, I'd like to see if you can help me by adding a menu by editing the .desktop, .menu and .directory files. I'm using lubuntu 14.04 and I can't get them to appear in the menu.

    Thank you