Revision [225]
This is an old revision of SoftwarePackageCreation made by coolpup on 2009-08-04 00:53:52.
- Create a .desktop file so that the menu will show an entry for that software application.
The rest of this page explains how to create a .desktop file.
.desktop File
Please use this template for the .desktop file. It adheres to the latest freedesktop specification. It is also displayed in the Appendix below.Once the file is created it needs to be located in this directory:
<code>
/usr/share/applications
</code>
The entries in the file are {key,value} pairs in the format:
<code>
Key=Value
</code>
Note that the <code>Encoding</code> key is deprecated, i.e. obsolete and no longer recognized. Any keys not found in the latest freedesktop specification are not recognized.
Keys are either optional or required. That is why the {key,value} pairs have been ordered into 3 groups. The first is required and the rest are optional. The second group will be often used, and the third is used under rare and special circumstances.
Menu and Desktop Icons
With regards to .PET package creation where should the menu icon files be placed and what size should they be (16x16, 24x24, or 48x48)?<br />There are necessarily different standard locations for different types of icons. <br />
/usr/local/libs/X11/mini-icons is for all of the sub-menu icons and the preferred size is 24x24 although most of the legacy icons are 16x16. These smaller versions will eventually be weeded out as resolutions increase and applications are updated. They were a legacy of early versions of JWM which didn't support larger menu icons.
/usr/local/libs/X11/pixmaps is only for the desktop icons that are part of the packaged desktop themes and their associated icons for the 1st level menus. For desktop icons the preferred size is 48x48. For 1st level menu icons the preferred size is 24x24. We also need to standardise on a given set of icons that constitutes a desktop theme. Some themes call icons by one name, others by another. That causes many problems. We are keen to ensure that /usr/local/libs/X11/pixmaps is kept exclusively for those icons that are used in the pinboard and 1st level menus. That is because that is what Barry's desktop icon switcher uses. We insist that only desktop theme icons go in /usr/local/lib/X11/pixmaps where they are regularly overwritten by themes from the /usr/local/libs/X11/themes directories.
Legacy locations from other Linux distributions (Debian, Red Hat, etc.) [We would like to be able to do away with them but the first converted .DEB or .RPM application that installs will place its own icons in there anyway.]
- /usr/share/icons is for application icons installed from 3rd party pet files and called from /usr/share/applicationsusr/share/pixmaps is for application icons installed from 3rd party pet files and called from /usr/share/applications/*.desktop files
Icon format is another bone of contention. The preferred format for <u>all</u> icons, regardless of their purpose, is .XPM format. Failing that, .PNG is to be preferred. Renaming .PNG files with an .XPM extension maintains some consistency of naming if not underlying format.
The puppy dotpet file should contain not one but <u>two</u> icons:
- one of 24x24 for the sub-menu (placed in <i>/usr/local/lib/X11/mini-icons</i>) and called into the menu from the associated <i>/usr/share/applications/*.desktop</i> file
- one of 48x48 for use with a desktop shortcut if the user creates one; the latter icon should be placed in either /usr/share/pixmaps or /usr/share/icons - /usr/share/pixmaps is preferred
Therefore the <i>abiword.desktop</i> file would be:
<code>
[Desktop Entry]
Type=Application
Name=AbiWord word processor
Exec=abiword
Comment=AbiWord word processor
Icon=/usr/local/lib/X11/mini-icons/abiword24.png
Categories=WordProcessor
</code>
Appendix
<u>All Puppy packagers are encouraged to use this template for the sake of standardization.</u><code>
[Desktop Entry]
Type=Application
Name=
Exec=
Comment=
Icon=/usr/local/lib/X11/mini-icons/iconfilename24.png
Categories=
#MimeType=
#Terminal=true
#GenericName=
#Comment=
#NoDisplay=
#Hidden=
#OnlyShowIn=
#NotShowIn=
#TryExec=
#Path=
#StartupNotify=true
#StartupWMClass=
#Name[az]=
#Name[bg]=
#Name[ca]=
#Name[cs]=
#Name[de]=
#Name[dz]=
#Name[el]=
#Name[en_CA]=
#Name[en_GB]=
#Name[es]=
#Name[et]=
#Name[fi]=
#Name[fr]=
#Name[ga]=
#Name[he]=
#Name[hr]=
#Name[hu]=
#Name[it]=
#Name[ja]=
#Name[ko]=
#Name[lt]=
#Name[lv]=
#Name[mk]=
#Name[ml]=
#Name[mr]=
#Name[ms]=
#Name[nb]=
#Name[ne]=
#Name[nl]=
#Name[nn]=
#Name[pl]=
#Name[pt]=
#Name[pt_BR]=
#Name[ru]=
#Name[sk]=
#Name[sr]=
#Name[sr@Latn]=
#Name[sv]=
#Name[te]=
#Name[tr]=
#Name[uk]=
#Name[vi]=
#Name[zh_CN]=
#Name[zh_TW]=
</code>