[opensuse-gnome] designing new default application selection (gnome_defaults.conf, defaults.list)
Hallo. We have a long time opened problem with association of default applications: https://bugzilla.novell.com/show_bug.cgi?id=456026 Also Moblin session would need different defaults than GNOME session. Easiest way seems to be adding this heuristic to the desktop-file-utils, which processes desktop files anyway, and allow defaults.list with (XDG) desktop prefix. Now I am thinking about the configuration file that should replace /etc/gnome_defaults.conf. It should be parseable as g_key_file (.ini file). Using experiences from the old syntax, two levels of preference seems to be required. It is possible to make more levels of preference, but I am not sure, whether it makes sense (to say: Use goodplayer.desktop. If betterplayer.desktop supports this MIME type, prefer it, but if bestplayer.desktop supports this MIME type, use it). Reversely, it is possible to live completely without two levels of preference, just with inheritance. Probably more files should be supported to allow separate e. g. gnome-defaults.conf and moblin-defaults.conf. Here is my idea. Any opinions? [Desktop Defaults] # ... maybe something will be here as well [GNOME] # These applications should be default for all MIME types they support. Default=eog.desktop;evince.desktop;gedit.desktop;file-roller.desktop;nautilus-folder-handler.desktop;MozillaFirefox.desktop # This application is preferred over Default applications for all MIME types they support. Prefer=banshee-1.desktop # but moonshine should be default for listed MIME types moonshine.desktop=video/x-ms-asf-plugin;video/x-ms-asf-plugin well, reverse syntax may be better, who knows video/x-ms-asf-plugin=moonshine.desktop video/x-ms-asf-plugin=moonshine.desktop # You may want to remove applications you inherit Remove=... # Or ignore some applications and never use them as default Ignore=... # If there is no application listed above, prefer application with these Categories: Categories=GNOME # And if everything fail, try inherited class Inherit=GTK [GTK] Categories=GTK # Well, items in [Desktop Defaults] are always inherited [KDE] ... -- Best Regards / S pozdravem, Stanislav Brabec software developer --------------------------------------------------------------------- SUSE LINUX, s. r. o. e-mail: sbrabec@suse.cz Lihovarská 1060/12 tel: +420 284 028 966, +49 911 740538747 190 00 Praha 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: opensuse-gnome+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-gnome+help@opensuse.org
Hi, Le mercredi 15 juillet 2009, à 20:30 +0200, Stanislav Brabec a écrit :
which processes desktop files anyway, and allow defaults.list with (XDG) desktop prefix.
Maybe reuse XDG_MENU_PREFIX for this? (also, make sure the file lives in /etc/xdg, maybe /etc/xdg/mime?)
[Desktop Defaults] # ... maybe something will be here as well
[GNOME] # These applications should be default for all MIME types they support. Default=eog.desktop;evince.desktop;gedit.desktop;file-roller.desktop;nautilus-folder-handler.desktop;MozillaFirefox.desktop # This application is preferred over Default applications for all MIME types they support. Prefer=banshee-1.desktop # but moonshine should be default for listed MIME types moonshine.desktop=video/x-ms-asf-plugin;video/x-ms-asf-plugin
Not a big fan of this syntax. I would prefer the reverse one, but:
well, reverse syntax may be better, who knows video/x-ms-asf-plugin=moonshine.desktop video/x-ms-asf-plugin=moonshine.desktop
video/x-ms-asf-plugin is not a valid key in such files: '/' cannot be used there. We can replace the '/' with a '-', though, and the first '-' will always be translated ti a '/'.
# You may want to remove applications you inherit Remove=...
Hrm, do we need this? I don't see the gain here.
# Or ignore some applications and never use them as default Ignore=...
Is this really useful? (and what's the difference with Remove?)
# If there is no application listed above, prefer application with these Categories: Categories=GNOME
Is this a list? If yes, it should be "GNOME;". What happens if you have more than one category there? Is this a "AND" or "OR" of those categories? Maybe name it PreferCategories?
# And if everything fail, try inherited class Inherit=GTK
Ok.
[GTK] Categories=GTK # Well, items in [Desktop Defaults] are always inherited
[KDE] ...
Vincent -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-gnome+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-gnome+help@opensuse.org
Vincent Untz wrote:
Hi,
Le mercredi 15 juillet 2009, à 20:30 +0200, Stanislav Brabec a écrit :
which processes desktop files anyway, and allow defaults.list with (XDG) desktop prefix.
Maybe reuse XDG_MENU_PREFIX for this? (also, make sure the file lives in /etc/xdg, maybe /etc/xdg/mime?)
Yes, for defaults.list it is a definitely a good idea. For defaults.conf or so it may be possible as well, but update-desktop-database then has to scan for all of them. I am not sure, whether there are benefits of a directory that contains parts of defaults.conf - e. g. defaults.conf.d.
[Desktop Defaults] # ... maybe something will be here as well
[GNOME] # These applications should be default for all MIME types they support. Default=eog.desktop;evince.desktop;gedit.desktop;file-roller.desktop;nautilus-folder-handler.desktop;MozillaFirefox.desktop # This application is preferred over Default applications for all MIME types they support. Prefer=banshee-1.desktop # but moonshine should be default for listed MIME types moonshine.desktop=video/x-ms-asf-plugin;video/x-ms-asf-plugin
Not a big fan of this syntax. I would prefer the reverse one, but:
well, reverse syntax may be better, who knows video/x-ms-asf-plugin=moonshine.desktop video/x-ms-asf-plugin=moonshine.desktop
video/x-ms-asf-plugin is not a valid key in such files: '/' cannot be used there. We can replace the '/' with a '-', though, and the first '-' will always be translated ti a '/'.
Well, the first one may result a smaller config file. But the second is more readable. And it makes easy to check, that no MIME type is used twice.
# You may want to remove applications you inherit Remove=...
Hrm, do we need this? I don't see the gain here.
# Or ignore some applications and never use them as default Ignore=...
Is this really useful? (and what's the difference with Remove?)
It was just an idea: Remove: Suppose you want to create a new session type MyGNOME. It should inherit on GNOME, but banshee should not be preferred there. If there is no other application for a particular MIME type, banshee may be still assigned as default. [MyGNOME] Inherit=GNOME Remove=banshee.desktop Ignore: Define a new session type, where banshee is never set in defaults.list: [MyFoo] Ignore=banshee.desktop
# If there is no application listed above, prefer application with these Categories: Categories=GNOME
Is this a list? If yes, it should be "GNOME;". What happens if you have more than one category there? Is this a "AND" or "OR" of those categories?
Well, not sure. It may be a list, and it may be just a single key and force virtual Inherit, if you need more keys. Allowing a list is probably a good idea. Inherited categories would be evaluated after the last item of the list. AND probably does not make sense. OR would be better. First wins may be a good rule that would allow definitions like: Categories=MyPreferredGNOMEApplication;GNOME;
Maybe name it PreferCategories?
Yes, it is possible. I just used key from desktop files.
# And if everything fail, try inherited class Inherit=GTK
Ok.
-- Best Regards / S pozdravem, Stanislav Brabec software developer --------------------------------------------------------------------- SUSE LINUX, s. r. o. e-mail: sbrabec@suse.cz Lihovarská 1060/12 tel: +420 284 028 966, +49 911 740538747 190 00 Praha 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: opensuse-gnome+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-gnome+help@opensuse.org
participants (2)
-
Stanislav Brabec
-
Vincent Untz