Mailinglist Archive: opensuse-gnome (50 mails)

< Previous Next >
Re: [opensuse-gnome] designing new default application selection (gnome_defaults.conf, defaults.list)
  • From: Stanislav Brabec <sbrabec@xxxxxxx>
  • Date: Mon, 27 Jul 2009 17:14:35 +0200
  • Message-id: <1248707675.15287.20.camel@xxxxxxxxxxxxxx>
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@xxxxxxx
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@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-gnome+help@xxxxxxxxxxxx

< Previous Next >