This is what freedesktop says about it:
"The Icon key of the desktop entry expanded as two arguments, first
--icon and then the value of the Icon key. Should not expand to any
arguments if the Icon key is empty or missing. "
some KDE apps have this "-caption %c" in a few variations. %c is "The
translated name of the application as listed in the appropriate Name key
in the desktop entry" according to freedesktop. All apps launch without a
problem without it as far as I can tell, so it's better to remove it than
have to deal with extra sets of nested quotes which behave differently in
each WM. This is not 100% failure-proof. There might be other variations
of this out there, but we can't account for every single one. If someone
finds one another one, I can always add it later.
In addition to other icon file types, also detect svgz icons. Do not
use them in any case, since none of the supported WMs can use them.
Also, make the extension detection case-insensitive. I've never seen an
icon extension with capitals in the wild, but who knows...
Finally, clean up the code a bit, so it reads easier.
When an svg icon is provided with a full path in the .desktop file,
strip the extension and path and look it up just as if only the icon
name was given.
By using the --max-icon-size option any icons that are larger than the
requested icon size get discarded. This is useful for at least Fvwm,
where the menus can hold icons of any size, with no option to resize to
a maximum size, making for some funny looking menus.
This adds a new dependency on the Pillow library, which is only loaded
if the --max-icon-size option is used.
Look into all subdirs of xdg directories like /usr/share/applications
etc for .desktop files. This will make applications that put their
.desktop files in places like /usr/share/applications/kde4 visible.
Support Python 2 and Python 3 at the same time.
* Make sure modules are loaded with the correct names for each version
* Use a compatibility layer for GTK
* Make sure strings are encoded/decoded properly