Support separate file "actions" via MIME-type

Alex Jones alex at weej.com
Mon Jun 12 20:40:19 EEST 2006


Hi

Originally posted on FDO Bugzilla
(https://bugs.freedesktop.org/show_bug.cgi?id=7184), but Owen Taylor
suggested I posted to this list to get some exposure.

Disclaimer: I don't fully understand the spec, yet.

Currently, file actions are linked to .desktop files on a one-to-one basis. For
example, AbiWord has a file, "abiword.desktop", which describes its Launcher
behaviour, including name, generic name, comment, categories (for application
organisation) and the command used to start the application.

If, for example, you wanted several actions for a particular file, you would
have to create separate .desktop files. You might want three actions for audio
files in Rhythmbox - "Play now in Rhythmbox", "Add to Rhythmbox library", "Queue
in Rhythmbox". I see no way you can do this without creating separate .desktop
files.

Can we alter the spec to allow for actions? Perhaps we can get rid of the
"MimeType" field in the .desktop files - I can't help but feel that it perhaps
doesn't belong there anyway. (You can create .desktop files on your Desktop on
GNOME and MimeType would bear no relevance, there.)

We could replace this functionality with .action files, for example (to
compliment fooplayer.desktop):

fooplayer-play-now.action:

[Desktop Entry]
Application=fooplayer
Name=Play now in Fooplayer
Name=[bla]=Bla bla bla Fooplayer
Comment=Plays the file immediately without adding it to your library
Exec=fooplayer --play-now %s
Icon=fooplayer-play-now
Terminal=false
MimeType=list/of;types/here

The "Application" field could correspond to a .desktop file ID (do they have a
formal name?) so that if you need to, you can reference more information about
the application. Perhaps this is actually unnecessary, I'm not 100% sure.

We could replace the concept of "Open With..." with "Other Actions..." where all
available file actions for all MIME types could be listed as candidates for the
current file.

I think it's important that each action can define its own list of MIME types -
applications may be able to do one thing with one set of types and other things
with others.

To maintain backwards compatibility, one potential solution would be to consider
all .desktop files with a MimeType field set to implicitly define a default
action, "Open with $APPNAME".

Thanks for reading!
-- 
Alex Jones <alex at weej.com>




More information about the xdg mailing list