Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hello,
- I would like to know how could I add a custom category in lxde menu.
- I already know how to add or modify applications changing .desktop entries under /usr/share/applications.
- What I would like to do is to add a complete new category on the menu and choose its position, for example "My Staff" after "Office" or "My Apps" before "Accessories" and then populating it by changing .desktop entries under /usr/share/applications.
- I tried to undesrtand something changing things under /etc/xdg/menus but I came to no point.
- I also discovered a useful tool to edit menu called lxmed
- http://lxmed.sourceforge.net/
- and using it I discovered I had hidden categories on my menu,
- for example there's a category called "Other" which is not shown on my menu.
- So: how can I (also) make visible hidden categories? Or viceversa how can I hide visible categories?
- Last thing: is it possible to add sub-categories?
- I mean category: Internet > subcategory: Browsers > applications: Chrome, Firefox, Opera
- and so on.
- Thanks for any help!
- It's probably easier to just change the menu in leafpad. You can add a menu to the layout by inserting something into the layout like:
- Code:
- <Menuname>Faves</Menuname>
- Then define the menu like this:
- Code:
- <Menu>
- <Name>Faves</Name>
- <AppDir>dir</AppDir>
- <Include>
- <All></All>
- </Include>
- </Menu>
- Then, any .desktop file you copy into the "dir" subfolder (of the folder where you store this .menu file) will appear in your submenu.
- Help yourself: Ubuntu Docs - Ubuntu Packages
- Thanks for your tip.
- Yes: that's was my idea too, but I haven't understood which is the menu file to change.
- Could you point me to the right file?
- Thanks
- If there isn't already a file in ~/.config/menus you should create that folder and copy one of the menus from /etc/xdg/menus into it first. Then edit the copy.
- Ok, many thanks for having pointed me to the right direction.
- I' ve found a working way to solve it, it's a little bit tricky, so not so easy, but it works.
- First of all I noticed it requires to have installed alacarte, I don't know what change this does but that's it.
- Maybe someone could explain me that, it would be great to know.
- So, for future reference, here's my howto to have a new main category with its sub-category on the menu:
- 1.
- As said install alacarte
- Code:
- sudo apt-get install alacarte
- 2.
- create a new file lxde-applications.menu under ~/.config/menus
- Code:
- touch ~/.config/menus/lxde-applications.menu
- edit it and add the follow:
- Code:
- leafpad ~/.config/menus/lxde-applications.menu
- HTML Code:
- <!DOCTYPE Menu
- PUBLIC '-//freedesktop//DTD Menu 1.0//EN'
- 'http://standards.freedesktop.org/menu-spec/menu-1.0.dtd'>
- <Menu>
- <Name>Applications</Name>
- <MergeFile type="parent">/etc/xdg/menus/lxde-applications.menu</MergeFile>
- <Directory>lxde-menu-applications.directory</Directory>
- <!-- Read standard .directory and .desktop file locations -->
- <DefaultAppDirs/>
- <DefaultDirectoryDirs/>
- <!-- Read in overrides and child menus from applications-merged/ -->
- <DefaultMergeDirs/>
- </Menu>
- 3
- create a new file scripts.menu under ~/.config/menus/applications-merged/
- Code:
- touch ~/.config/menus/applications-merged/scripts.menu
- edit it and add the follow:
- Code:
- leafpad ~/.config/menus/scripts.menu
- HTML Code:
- <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
- "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
- <Menu>
- <Name>Applications</Name>
- <Menu>
- <Name>MY Scripts</Name>
- <Directory>scripts.directory</Directory>
- <Include>
- <Filename>scripts-app1.desktop</Filename>
- </Include>
- <Menu>
- <Name>Scripts Folder</Name>
- <Directory>scripts-folder.directory</Directory>
- <Include>
- <Filename>scripts-app2.desktop</Filename>
- </Include>
- </Menu>
- </Menu>
- </Menu>
- 4
- create a new file scripts.directory under ~/.local/share/desktop-directories/
- Code:
- touch ~/.local/share/desktop-directories/scripts.directory
- edit it and add the follow:
- Code:
- leafpad ~/.local/share/desktop-directories/scripts.directory
- HTML Code:
- [Desktop Entry]
- Encoding=UTF-8
- Icon=utilities-terminal
- Type=Directory
- Name=Scripts
- 5
- create a new png icon under
- ~/.local/share/icons/
- and call it scripts-app1.png
- 6
- create a new file scripts-app1.desktop under ~/.local/share/applications/
- Code:
- touch ~/.local/share/applications/scripts-app1.desktop
- edit it and add the follow:
- Code:
- leafpad ~/.local/share/applications/scripts-app1.desktop
- HTML Code:
- [Desktop Entry]
- Type=Application
- Name=Scripts First Application
- Comment=Here your comment
- Exec=lxterminal %u
- Icon=scripts-app1
- Categories=PackageManager;GTK;
- 7
- create a new file scripts-folder.directory under ~/.local/share/desktop-directories/scripts-folder.directory
- Code:
- touch ~/.local/share/desktop-directories/scripts-folder.directory
- edit it and add the follow:
- Code:
- leafpad ~/.local/share/desktop-directories/scripts-folder.directory
- HTML Code:
- [Desktop Entry]
- Type=Directory
- Name=Scripts Folder
- Icon=folder
- 8
- create a new png icon under
- ~/.local/share/icons/
- and call it scripts-app2.png
- 9
- create a new file scripts-app2.desktop under ~/.local/share/applications/
- Code:
- touch ~/.local/share/applications/scripts-app2.desktop
- edit it and add the follow:
- Code:
- leafpad ~/.local/share/applications/scripts-app2.desktop
- HTML Code:
- [Desktop Entry]
- Type=Application
- Name=Scripts Second Application
- Comment=Here your comment
- Exec=lxterminal %u
- Icon=scripts-app2
- Categories=PackageManager;GTK;
- Then you have to refresh you lxpanel by loggin out and in again or by killing it and restarting it.
- Code:
- killall lxpanel
- lxpanel
- To complete you can use alacarte to hide/show your categories/sub-categories/elements
- I still haven't worked on this to know how it does it,
- maybe in the future I will investigate on it or maybe someone can help me in that.
- For now this works for me!
- Hope this may help.
- Cheers
- That looks like a lot of trouble just to avoid understanding how the Layout or Include tags work. But if it works, it works. Good job.
Add Comment
Please, Sign In to add comment