missing a .desktop files howto

D. Marlin damarlin at gmail.com
Thu Sep 4 09:28:43 PDT 2008


Matej Tyc wrote:
> Hello,
> I am developing an application that could use a menu entry. I have 
> learned that I have to drop an appropriate .desktop file to 
> /usr/share/applications, but I have problems with icons.
> If I write Icon=foo, then where to put the actual icon?

I'm not an expert on this, but one location where you can place an icon 
is in $PREFIX/share/pixmaps, i.e.:

   /usr/share/pixmaps/

You'll find a lot of icons there.

As I understand it, there are alternate icon locations that make up the 
search path, including paths for themes, but I don't know the full 
search path right now.  Maybe someone else here can clue me in.  ;-)

> Anyway, I don't understand where people get those information and how 
> come that there are so many things in menus since it is so hard to find 
> a howto :-) Really, I have searched quite a lot and I wasn't able to 
> find a user friendly guide...

I use the existing code as a guide.  Just pick your favorite application 
and look where it stores things...

> And does anyone here have any experience how to install .desktop files 
> using autotools?

for example, if you look at Makefile.am for gpe-irc (one I happen to be 
looking at now) you will see:

   desktopdir = $(datadir)/applications
   desktop_in_files = gpe-irc.desktop.in

   desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
   @INTLTOOL_DESKTOP_RULE@

This defines the desktop file and where to put it, and ...

   pixmapsdir = $(datadir)/pixmaps
   pixmaps_DATA =  gpe-irc.png

defines the icon file and where to put it.


These (along with other files) get installed by:

   EXTRA_DIST = $(desktop_DATA) \
                $(pixmaps_DATA) \
		:

You can copy those bits into your Makefile.am (changing the names, where 
appropriate) and automake should produce the Makefile you want.

The full spec for the desktop files can be found at:

   http://standards.freedesktop.org/desktop-entry-spec/latest/

I hope this helps.


d.marlin
=========

> Regards,
> Matej
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> xdg mailing list
> xdg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xdg



More information about the xdg mailing list