johnaaronrose
Posts: 57
Joined: Fri Apr 27, 2012 8:15 pm

Adding a Category to the Menu

Mon Apr 13, 2015 4:59 pm

I wanted a new category to the Menu. So I installed alacarte & its dependencies. However, when I run it, I get:
pi@raspberrypi ~ $ alacarte
Traceback (most recent call last):
File "/usr/bin/alacarte", line 23, in <module>
from Alacarte.MainWindow import MainWindow
File "/usr/share/alacarte/Alacarte/MainWindow.py", line 32, in <module>
from Alacarte.MenuEditor import MenuEditor
File "/usr/share/alacarte/Alacarte/MenuEditor.py", line 23, in <module>
from Alacarte import util
File "/usr/share/alacarte/Alacarte/util.py", line 25, in <module>
from gi._glib import GError
ImportError: cannot import name GError

I get the same with sudo alacarte. Help please!

mob-i-l
Posts: 315
Joined: Sat Dec 29, 2012 2:45 am
Location: Lund, Skåne/Scania, Sweden
Contact: Website Facebook Google+ Twitter YouTube

Re: Adding a Category to the Menu

Mon Apr 13, 2015 8:20 pm

Maybe it doesn't work because Raspbian uses LXDE and not GNOME, but I'm not an expert. I used these instructions before to add categories: https://lkubaski.wordpress.com/2012/11/ ... -sections/
This may not work without changes if you use the new UI (package: raspberrypi-ui-mods).
Have Pi0&1A&1B&1B+&2B&3B&4B w/ Raspbian. Started w/ BASIC on ABC80&ZX81 then Forth, Z80… https://scratch.mit.edu/users/mobluse/ https://github.com/mobluse/ https://twitter.com/mobluse/ https://YouTube.com/MOBiL4u/

johnaaronrose
Posts: 57
Joined: Fri Apr 27, 2012 8:15 pm

Re: Adding a Category to the Menu

Tue Apr 14, 2015 1:45 pm

Silly me. Of course, alacarte is not applicable to Raspbian because it uses LXDE not Gnome. I wanted to use an existing Debian category (i.e. Science). To do that, I did 'sudo /etc/xdg/menus/lxde-applications.menu' followed by creating a copy of the Office lines (changing Office to Science) in the appropriate alphabetic order (i.e. after the Office lines). Thus, I added:
<!-- Science -->
<Menu>
<Name>Science</Name>
<Directory>lxde-science.directory</Directory>
<Include>
<And>
<Category>Science</Category>
</And>
</Include>
</Menu> <!-- End Science -->

Return to “Raspberry Pi OS”