To integrate webnail with a computer's window system, one will have to
configure the window system to use webnail's icons and to recognize
file extensions and media types: that is, so that the webnail
application is shown with an icon specific to it by the window system,
and webnail-specific files are shown by a file manager with a
webnail-supplied icon.  This is not necessary for running webnail as
webnail's GUI gets its icons from webnail's JAR file.

If webnail is installed using Debian packages, the window system will
be configured as part of the installation.  For other cases (e.g.,
when using the installer), this currently has to be done manually.

The webnail directory (/usr/local/share/webnail or /opt/webnail for
Unix/Linux/MacOs and %PROGRAMDATA%\webnail for Windows) contains a
file named share.zip. On systems that support the freedesktop.org
standards one should look at the environment variables
XDG_DATA_HOME and XDG_DATA_DIRS. These typically define directory
search paths, and will typically have a directory /usr/share in
one of these paths. With /usr/share as an example, running

    sudo unzip share.zip -d /usr/share/
    sudo update-mime-database

will create the necessary files.  In other cases, one will have to
follow whatever procedure that particular window system and operating
system uses.

To configure a window-system that does not follow the freedesktop.org
standard, one should start by extracting various files from
share.zip. Some of these files can be read as text files and provide
specifications for how the window system should be configure.  Other
files provide icons.  The file share.zip contains the following
directories:

    * mime/

    * icons/

    * applications/

The file mime/packages/webnail.xml uses the freedesktop.org format
described in

   <http://standards.freedesktop.org/shared-mime-info-spec/
    shared-mime-info-spec-0.18.html#idm140001680036896>

and describes what patterns in a file and what file-name extensions
imply that the file has a particular media type.

The icons directory contains a directory named hicolor, which
contains directories name scalable and NxN, where N = 16, 20, 22, 24,
32, 36, 48, 64, 72, 96, 128, 192, and 256. Each of these directories
contains subdirectories named apps (each of which contains an icon used by
the webnail application) and mimetypes (which contains the icons used
by a file manager to represent various file types).  The files are the
following:

    icons/hicolor/scalable/apps/webnail.svg
    icons/hicolor/NxN/apps/webnail.png
    icons/hicolor/scalable/mimetypes/application-x.webnail+xml.svg
    icons/hicolor/scalable/mimetypes/application-x.webnail-layout+xml.svg
    icons/hicolor/scalable/mimetypes/application-x.webnail-templates+xml.svg
    icons/hicolor/NxN/mimetypes/application-x.webnail+xml.png
    icons/hicolor/NxN/mimetypes/application-x.webnail-layout+xml.png
    icons/hicolor/NxN/mimetypes/application-x.webnail-templates+xml.png

where N = 16, 20, 22, 24, 32, 36, 48, 64, 72, 96, 128, 192, and
256. The "scalable" directories represent icons with SVG (Scalable
Vector Graphics) files so that icons of any desired size can be
created.  The NxN directories contain PNG (Portable Network Graphics)
files with the images having fixed sizes (N is the number of pixels
for the width and height).  The icons whose names start
with "application-" correspond to media types that start with the
string "application/" so application-x.webnail+xml.svg is an icon for
the media type application/x.webnail+xml.

The applications directory contains the file

    applications/webnail.desktop

whose syntax is described in
<https://specifications.freedesktop.org/desktop-entry-spec/latest/>.
This particular example uses a syntax appropriate for Ubuntu-Linux
systems.

The behavior one wants is to (a) show the appropriate icon for a file
in a file manager window, (b) to allow the webnail application to be
easily started from a GUI, and (c) double clicking a file whose
mime type is application-x.webnail+xml (the preferred extension is "wnl")
should start the webnail application by running
       webnail --gui FILENAME
where FILENAME is the name of a file whose extension is typically "wnl"
("xml" may be recognized as well).
