Revision [156]
This is an old revision of SoftwarePackageCreation made by coolpup on 2009-08-02 00:20:58.
<br />
<li><a href="/wiki/compiling">Compile, install, & create .PET in five commands</a></li>
<li>Create a <i>.desktop</i> file so that the menu will show an entry for that software application.</li>
<br />
The rest of this page explains how to create a <i>.desktop</i> file.
<br />
<h3>.desktop File</h3>
Please use this <a href="http://puppylinux.asia/members/coolpup/.desktop/a-application_template.desktop">template</a> for the <i>.desktop</i> file. It adheres to the <a href="http://standards.freedesktop.org/desktop-entry-spec/latest/index.html">latest freedesktop specification</a>. It is also displayed in the <i>Appendix</i> below.
<br />
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.
<br />
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.
<br />
<h3>Menu and Desktop Icons</h3>
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 />
<br />
There are necessarily different standard locations for different types of icons. <br />
<br />
<b>/usr/local/libs/X11/mini-icons</b> 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. <br />
<br />
<b>/usr/local/libs/X11/pixmaps</b> 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.<br />
<br />
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.]<br />
<li><b>/usr/share/icons</b> is for application icons installed from 3rd party pet files and called from <i>/usr/share/applications/*.desktop files</i></li> <br />
<li><b>/usr/share/pixmaps</b> is for application icons installed from 3rd party pet files and called from <i>/usr/share/applications/*.desktop files</i></li>
<br />
<br />
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.
<br />
The puppy dotpet file should contain not one but <u>two</u> icons:
<br />
<li>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</li> <br />
<li>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</li>
<br />
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>
<br />
<h3>Appendix</h3>
<u>All Puppy packagers are encouraged to use this template for the sake of standardization.</u>
<br />
<code>
[Desktop Entry]
Type=Application
Name=
Exec=
<br />
Comment=
Icon=/usr/local/lib/X11/mini-icons/iconfilename24.png
Categories=
<br />
#MimeType=
#Terminal=true
#GenericName=
#Comment=
#NoDisplay=
#Hidden=
#OnlyShowIn=
#NotShowIn=
#TryExec=
#Path=
#StartupNotify=true
#StartupWMClass=
<br />
#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>