<div dir="ltr"><div>Look at /etc/xdg/menus/gnome-applications.menu:<br><br>  <!-- Internet --><br>  <Menu><br>    <Name>Internet</Name><br>    <Directory>Network.directory</Directory><br>
    <Include><br>      <And><br>        <Category>Network</Category><br>    <Not><Category>X-GNOME-WebApplication</Category></Not><br>      </And><br>    </Include><br>
<br>    <Exclude><br>      <!-- Utilities exclusions --><br>      <Filename>vinagre.desktop</Filename><br><br>      <!-- Sundry exclusions --><br>      <Filename>javaws.desktop</Filename><br>
    </Exclude><br>  </Menu>   <!-- End Internet --><br><br></div>Alacarte loads the existing menu file, notes the category it was in, and puts an Exclude for it.<br></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Mon, May 12, 2014 at 12:41 PM, Jerome Leclanche <span dir="ltr"><<a href="mailto:adys.wh@gmail.com" target="_blank">adys.wh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you're looking for code,<br>
<a href="https://github.com/lxde/libqtxdg/blob/master/xdgmenu.cpp" target="_blank">https://github.com/lxde/libqtxdg/blob/master/xdgmenu.cpp</a> is a good<br>
starting point.<br>
J. Leclanche<br>
<div><div class="h5"><br>
<br>
On Mon, May 12, 2014 at 5:26 PM, José Félix Ontañon<br>
<<a href="mailto:fontanon@emergya.com">fontanon@emergya.com</a>> wrote:<br>
> Hi,<br>
><br>
> I'm trying to build an app that automatizes the excluding of some launchers<br>
> from menu, by tweaking ~/.config/xdg/menus I've noticed the Categories in<br>
> the xdg-desktop aren't the same as the menu names in xdg-menu.<br>
><br>
> So, the question is given a .desktop file, how to know the name of it's<br>
> corresponding menu?<br>
><br>
> ::Example::<br>
><br>
> The firefox desktop file has as categories:<br>
> Categories=GNOME;GTK;Network;WebBrowser;<br>
><br>
> But the the menu names that needs to be indicated to exclude firefox from<br>
> the menu is Applications->Internet. Below the code produced by Alacarte:<br>
><br>
> <Menu><br>
>     <Name>Applications</Name><br>
>     <MergeFile<br>
> type="parent">/etc/xdg/menus/gnome-applications.menu</MergeFile><br>
>     <Menu><br>
>         <Name>Internet</Name><br>
>         <Exclude><br>
>             <Filename>firefox.desktop</Filename><br>
>         </Exclude><br>
>     </Menu><br>
> </Menu><br>
><br>
> I don't understand how Alacarte got that Applications->Internet path given<br>
> the firefox.desktop file.<br>
><br>
> Regards!<br>
><br>
> --<br>
> J. Félix Ontañón Carmona<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> xdg mailing list<br>
> <a href="mailto:xdg@lists.freedesktop.org">xdg@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/xdg" target="_blank">http://lists.freedesktop.org/mailman/listinfo/xdg</a><br>
><br>
_______________________________________________<br>
xdg mailing list<br>
<a href="mailto:xdg@lists.freedesktop.org">xdg@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/xdg" target="_blank">http://lists.freedesktop.org/mailman/listinfo/xdg</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>  Jasper<br>
</div>