DefaultApplicationPriorities

Differences between revisions 13 and 14
Revision 13 as of 2009-06-08 12:46:37
Size: 2964
Editor: pD9EB44CA
Comment:
Revision 14 as of 2009-08-02 08:39:33
Size: 6435
Editor: put92-5-82-243-237-71
Comment:
Deletions are marked like this. Additions are marked like this.
Line 52: Line 52:
== Mail proposal to fdo ==

Have a way to dynamically change software associations at distribution level

Hello everyone,

Right now, GNU/Linux distributions (Debian, Ubuntu, from what I see it seems to apply to Fedora, OpenSuse and Mandrake too…) use a static defaults.list file in $XDG_DATA_DIRS/applications shipped by the distribution for associating a mimetype to a default application.
We currently, for Ubuntu, symlink it to /etc/gnome/defaults.list.
That means that when we set a software as the default distribution default dvd player for example, this means that if a user buy a better player with codec they don't get this one used by default without changing user's personal preferences. We want to change the system to have a priority number rather than a default hardcoded, ie powerdvd would have a higher priority than totem (for Ubuntu for example) so it will be used when installed.

To handle application priorities, the idea is to rely on the .desktop files having an optional InitialPreference=<Priority> (similar key to what KDE is using), a default priority will be used if there is no such key.
We can setup a 100 priority for defaults application actually in defaults.list for distros, 50 as the default priority if the key is not present in the .desktop file.

This is proposal for changing http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec and http://www.freedesktop.org/wiki/Specifications/desktop-entry-spec specifications to handle those use cases.
The main goal is to keep retro-compatibility for people who doesn't want to change their defaults.list. As we don't change the actual layer of user choice in $XDG_DATA_HOME > defaults choice in $XDG_DATA_DIRS/applications, I will just emphasize about defaults.list and the cache:
The priority order would be:
    * mimeapps.list for sysadmin
    * defaults.list for distro and compatibility (at the end, distribution wanted to use this dynamic association will no more ship it)
    * mimeinfo.cache autobuilt

Upading mimeinfo.cache file will be made as of today, when executing the shared-mime-info update-desktop-database tool. It will order the list of desktop file in the same order than the priorities in desktop files.

That would mine with that example:
application/ogg=gnome-mplayer.desktop;vlc.desktop;kde4-amarok.desktop;mplayer.desktop;rhythmbox.desktop;totem.desktop;
gnome-mplayer.destkop priority < vlc.desktop priority < kde4…

We want also to take into account the current desktop environment. For instance, with this example, if you are running KDE, the distribution default choice (if no user choice is setup) would be totem instead of amarok. To avoid this issue categories will be used to prefer the application matching the desktop when there are several choices (ie KDE category when using KDE and so, amarok will be used in a KDE environment and totem in the GNOME one, if the user doesn't change its own preferences).
So, the default choice rule (if the user didn't change anything and the distro don't ship a defaults.list for this mime type) will be : the last .desktop application file found, having a category corresponding to my current desktop environment. If no .desktop file with this category is found, we fallback to the last entry.


What do you think about it? I only take a look at glib (more precisely, the gio module) and update-mime-info and the code to write to achieve that goal seems minimal.

Summary

The specification describes how the static list shipped with the distribution and describing the application to use for a mimetype will be changed to a dynamic one

Release Note

This section should include a paragraph describing the end-user impact of this change. It is meant to be included in the release notes of the first release in which it is implemented. (Not all of these will actually be included in the release notes, at the release manager's discretion; but writing them is a useful exercise.)

It is mandatory.

Rationale

The static list used currently doesn't allow distributors to change a default application easily (vendors installing a commercial DVD players probably want this one to be used by default)

User stories

  • Daniel decides to buy a better DVD player than the one coming with Ubuntu, it goes on the Canonical store and buy a commercial player there, this one should be used once installed
  • Vincent works for a company which use Ubuntu on their computer, the employees there need pdf editing which is something evince doesn't do though, they install their own pdf viewer and editor and want it to be used by default

Design

  • The .desktop files will have an optional InitialPreference=<Priority> (similar key to what KDE is using), a default priority will be used if there is no such key

  • The priorities to use will be described in a policy document stored on wiki.ubuntu.com, an email describing the policy will be sent to the ubuntu lists
  • /usr/share/applications/defaults.list will not be shipped with new version but still read for compatibility reason (it is symlinked to /etc/gnome/defaults.list, which will be removed on upgrades if unmodified).

  • The cache format will be changed to list priorities, the cache filename need to be changed to reflect the compatibility breakage
  • The categories will be used to prefer the application matching the desktop when there are several choices (ie GNOME category when using GNOME)
  • The shared-mime-info update-desktop-database tool will be updated to write the new cache
  • glib needs to be update to understand the new format

The priority order will be:

  • mimeapps.list for sysadmin
  • defaults.list for distro and compatibility
  • mimeinfo.cache autobuilt

Migration

There is no migration required, a new cache will be used and the previous defaults.list still used for compatibility

Test/Demo Plan

  • Double click on a video in nautilus and verify that totem is launched
  • Install a player using a higher priority number
  • Double click on a video in nautilus and verify that the new player is launched

Mail proposal to fdo

Have a way to dynamically change software associations at distribution level

Hello everyone,

Right now, GNU/Linux distributions (Debian, Ubuntu, from what I see it seems to apply to Fedora, OpenSuse and Mandrake too…) use a static defaults.list file in $XDG_DATA_DIRS/applications shipped by the distribution for associating a mimetype to a default application. We currently, for Ubuntu, symlink it to /etc/gnome/defaults.list. That means that when we set a software as the default distribution default dvd player for example, this means that if a user buy a better player with codec they don't get this one used by default without changing user's personal preferences. We want to change the system to have a priority number rather than a default hardcoded, ie powerdvd would have a higher priority than totem (for Ubuntu for example) so it will be used when installed.

To handle application priorities, the idea is to rely on the .desktop files having an optional InitialPreference=<Priority> (similar key to what KDE is using), a default priority will be used if there is no such key. We can setup a 100 priority for defaults application actually in defaults.list for distros, 50 as the default priority if the key is not present in the .desktop file.

This is proposal for changing http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec and http://www.freedesktop.org/wiki/Specifications/desktop-entry-spec specifications to handle those use cases. The main goal is to keep retro-compatibility for people who doesn't want to change their defaults.list. As we don't change the actual layer of user choice in $XDG_DATA_HOME > defaults choice in $XDG_DATA_DIRS/applications, I will just emphasize about defaults.list and the cache: The priority order would be:

  • mimeapps.list for sysadmin
  • defaults.list for distro and compatibility (at the end, distribution wanted to use this dynamic association will no more ship it)
  • mimeinfo.cache autobuilt

Upading mimeinfo.cache file will be made as of today, when executing the shared-mime-info update-desktop-database tool. It will order the list of desktop file in the same order than the priorities in desktop files.

That would mine with that example: application/ogg=gnome-mplayer.desktop;vlc.desktop;kde4-amarok.desktop;mplayer.desktop;rhythmbox.desktop;totem.desktop; gnome-mplayer.destkop priority < vlc.desktop priority < kde4…

We want also to take into account the current desktop environment. For instance, with this example, if you are running KDE, the distribution default choice (if no user choice is setup) would be totem instead of amarok. To avoid this issue categories will be used to prefer the application matching the desktop when there are several choices (ie KDE category when using KDE and so, amarok will be used in a KDE environment and totem in the GNOME one, if the user doesn't change its own preferences). So, the default choice rule (if the user didn't change anything and the distro don't ship a defaults.list for this mime type) will be : the last .desktop application file found, having a category corresponding to my current desktop environment. If no .desktop file with this category is found, we fallback to the last entry.

What do you think about it? I only take a look at glib (more precisely, the gio module) and update-mime-info and the code to write to achieve that goal seems minimal.


CategorySpec

DesktopTeam/Specs/Karmic/DefaultApplicationPriorities (last edited 2009-08-04 07:17:14 by 91)