Discussion:
Modifying an existing desktop file's MimeTypes
Jerome Leclanche
2014-01-11 02:28:18 UTC
Permalink
Consider the following use case:

"gimp" supports image/png. "gimp-webp-plugin" makes gimp support image/webp.

How would gimp-webp-plugin declare that it makes another app support
additional mime types? I don't think it's possible currently.
Suggestions?

Mime actions could theoretically do that (in a system-level
mimeapps.list), but most package managers do not have the ability to
modify a file shared by multiple packages (we'd have to create
something silly like /usr/share/applications/actions.d/).

J. Leclanche
Albert Astals Cid
2014-01-11 12:36:50 UTC
Permalink
El Dissabte, 11 de gener de 2014, a les 02:28:18, Jerome Leclanche va
Post by Jerome Leclanche
"gimp" supports image/png. "gimp-webp-plugin" makes gimp support image/webp.
How would gimp-webp-plugin declare that it makes another app support
additional mime types? I don't think it's possible currently.
Suggestions?
In Okular we just install another .desktop with the same main keys (Name,
exec, type, etc) except it has a different mimetype and NoDisplay=true

That works fine under KDE but I've been told not so good under
gnome/glib/gtk/whatever does the .desktop parsing.

IMHO it's quite a clean an easy way to do it, but I do not have much in depth
knowledge of how this works/is supposed to work.

Cheers,
Albert
Post by Jerome Leclanche
Mime actions could theoretically do that (in a system-level
mimeapps.list), but most package managers do not have the ability to
modify a file shared by multiple packages (we'd have to create
something silly like /usr/share/applications/actions.d/).
J. Leclanche
_______________________________________________
xdg mailing list
http://lists.freedesktop.org/mailman/listinfo/xdg
Bastien Nocera
2014-01-13 08:50:11 UTC
Permalink
Post by Albert Astals Cid
El Dissabte, 11 de gener de 2014, a les 02:28:18, Jerome Leclanche va
Post by Jerome Leclanche
"gimp" supports image/png. "gimp-webp-plugin" makes gimp support image/webp.
How would gimp-webp-plugin declare that it makes another app support
additional mime types? I don't think it's possible currently.
Suggestions?
In Okular we just install another .desktop with the same main keys (Name,
exec, type, etc) except it has a different mimetype and NoDisplay=true
That works fine under KDE but I've been told not so good under
gnome/glib/gtk/whatever does the .desktop parsing.
IMHO it's quite a clean an easy way to do it, but I do not have much in depth
knowledge of how this works/is supposed to work.
It works fine under GNOME, but it will break some other functionality
like "Default applications" because there's no way to back link to the
original desktop file (the one without NoDisplay=true).
Jerome Leclanche
2014-01-13 09:41:28 UTC
Permalink
I'd say anything that breaks the "one app per desktop file" idiom is a
bad idea. It breaks the entire declarative way behind desktop file and
can cause all sorts of problems; what you just mentioned is one
instance of it. Seeing duplicates in launchers, menus etc can be
another (nevermind NoDisplay).
J. Leclanche
Post by Bastien Nocera
Post by Albert Astals Cid
El Dissabte, 11 de gener de 2014, a les 02:28:18, Jerome Leclanche va
Post by Jerome Leclanche
"gimp" supports image/png. "gimp-webp-plugin" makes gimp support image/webp.
How would gimp-webp-plugin declare that it makes another app support
additional mime types? I don't think it's possible currently.
Suggestions?
In Okular we just install another .desktop with the same main keys (Name,
exec, type, etc) except it has a different mimetype and NoDisplay=true
That works fine under KDE but I've been told not so good under
gnome/glib/gtk/whatever does the .desktop parsing.
IMHO it's quite a clean an easy way to do it, but I do not have much in depth
knowledge of how this works/is supposed to work.
It works fine under GNOME, but it will break some other functionality
like "Default applications" because there's no way to back link to the
original desktop file (the one without NoDisplay=true).
_______________________________________________
xdg mailing list
http://lists.freedesktop.org/mailman/listinfo/xdg
David Faure
2014-01-13 11:09:31 UTC
Permalink
Post by Bastien Nocera
Post by Albert Astals Cid
El Dissabte, 11 de gener de 2014, a les 02:28:18, Jerome Leclanche va
Post by Jerome Leclanche
"gimp" supports image/png. "gimp-webp-plugin" makes gimp support image/webp.
How would gimp-webp-plugin declare that it makes another app support
additional mime types? I don't think it's possible currently.
Suggestions?
In Okular we just install another .desktop with the same main keys (Name,
exec, type, etc) except it has a different mimetype and NoDisplay=true
That works fine under KDE but I've been told not so good under
gnome/glib/gtk/whatever does the .desktop parsing.
IMHO it's quite a clean an easy way to do it, but I do not have much in
depth knowledge of how this works/is supposed to work.
It works fine under GNOME, but it will break some other functionality
like "Default applications" because there's no way to back link to the
original desktop file (the one without NoDisplay=true).
Maybe we just need to add a link back to the main desktop file, by adding a
line in the secondary desktop file like
RelatesTo=okular.desktop
?

The whole idea being that existing implementation can just ignore that, so
this is backwards compatible.
--
David Faure, ***@kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5
Loading...