missing a .desktop files howto

Rodney Dawes dobey.pwns at gmail.com
Thu Sep 4 09:10:02 PDT 2008


On Thu, 2008-09-04 at 17:53 +0200, Matej Tyc wrote:
> Hello,
> I am developing an aplication 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? 

As per the Icon Theme Specification and the Icon Naming Specification,
your icon name should match the binary name of your application, and
be installed in the hicolor icon theme's apps context directory.

/usr/share/icons/hicolor/48x48/appname.png
/usr/share/icons/hicolor/32x32/appname.png
/usr/share/icons/hicolor/22x22/appname.png
/usr/share/icons/hicolor/16x16/appname.png

These are the most important sizes to provide with your application.

> 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...
> 
> And does anyone here have any experience how to install .desktop files
> using autotools?

There are multiple ways to do this, depending on how you are translating
the .desktop file, if you even are at all. You can look at almost any
GNOME application to see how it is done when using intltool to handle
your translations. It's basically something like:

desktopdir = $(datadir)/applications
desktop_in_files = appname.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)

@INTLTOOL_DESKTOP_RULE@

If you're not translating at all, then the following is sufficient:

desktopdir = $(datadir)/applications
desktop_DATA = appname.desktop


-- Rodney





More information about the xdg mailing list