<div dir="ltr"><div><div>It was finally done in the spirit of alacarte, using the xdg-ruby library by C.L. Ramsey <a href="https://github.com/dark-yux/xdg-ruby">https://github.com/dark-yux/xdg-ruby</a></div><div>Now a chef-recipe is ready, allowing sysadmins to modify users menu:</div>
<div><a href="https://github.com/gecos-team/gecos-workstation-management-cookbook/blob/desktop_menu/providers/desktop_menu.rb">https://github.com/gecos-team/gecos-workstation-management-cookbook/blob/desktop_menu/providers/desktop_menu.rb</a></div>
<div><br></div><div>Thanks Jasper, Jerome. Your tips have driven me to the solution.</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-12 18:53 GMT+02:00 Jasper St. Pierre <span dir="ltr"><<a href="mailto:jstpierre@mecheye.net" target="_blank">jstpierre@mecheye.net</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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"><div><div class="h5">
<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><br>
<br>
On Mon, May 12, 2014 at 5:26 PM, José Félix Ontañon<br>
<<a href="mailto:fontanon@emergya.com" target="_blank">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" target="_blank">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" target="_blank">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></div></div><span class="HOEnZb"><font color="#888888">-- <br> Jasper<br>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">J. Félix Ontañón Carmona<br>Consultor Externo<br><br>Emergya Consultoría <br>Tfno: +34 954 51 75 77 / +34 661 91 27 26<br>Fax: +34 954 51 64 73<br>
<a href="http://www.emergya.es" target="_blank">www.emergya.es</a></div>
</div>