[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ассоциации файлов в гноме



Ответ дал Павел Чебукин, только не в рассылку а лично мне. Вот он:

Ответ на ваш вопрос, правда на английском, но суть ясна:
"Finally I solved my concrete problem by editing my
~/.local/share/applications/mimeinfo.cache file, locating the faulty
application (quanta) and removing it. It remains a mystery how
Gnome/Nautilus determines which file to use on double-clicking a
shortcut, but hey, it worked. It seems that deleting the mimeinfo.cache
file often fixes problems.

I wrote a little summary of my (limited) understanding of how Gnome
handles file associations (not guaranteed to be accurate ;). Here it is,
in case it might be of some help to others:

--------------------------------------------------------------------
Usually you change file associations in Gnome/Nautilus by right-clicking
on a file -> Properties -> "Opens With" tab. However, in some occasions,
it does not work (eg. HTML shortcuts dragged to the desktop have no such
tab). It is also interesting to know where the corresponding files are
located.

Gnome (2.18.1) defines file associations at both a global level (common
for all users) and a local (per user) level.

Global level:

/usr/share/applications/<application>.desktop - Description of one
application. KDE apps are in a subfolder kde/. MIME types supported by
an aplication are declared in the MimeType property, e.g.
MimeType=text/html;text/css;

/usr/share/applications/defaults.list - Defines which applications
(described by their .desktop file) to use when double-clicking (=default
open) on files, depending on their MIME-type, e.g. text/html=firefox.desktop
...will start firefox when double-clicking a HTML file.

/usr/share/mimeinfo.cache - This file has the same format as
defaults.list, but it defines the list of applications that can open
each MIME type. It is built (when?) by Gnome from the .desktop files.
Excerpt:
text/html=firefox.desktop;bluefish.desktop;kde-quanta.desktop;kde-kimagemapeditor.desktop;

Local level

Each user override/merge with global definitions by defining the same
files in their ~/.local/share/applications/ folder:

~/.local/share/applications/<application>.desktop - Description of
applications. Overrides the global def for each application if it exists.

~/.local/share/applications/defaults.list - Behavior on double-click
(default open). Override the global definition, e.g.:
text/html=dreamweaver-usercreated.desktop ...will open an HTML with
dreamweaver on double-click (in Nautilus) for the current user only
(while the global default was to start firefox)

~/.local/share/applications/mimeinfo.cache - Same as global
mimeinfo.cache. Lists the application to use for each MIME-type. This
list, merged in alpha order with the global one, is the list displayed
by Nautilus in the "open with" listbox. Example:
text/html=dreamweaver-usercreated.desktop;kde-quanta.desktop;

In case of strange behavior (e.g. the file doesn't open whith the
expected application on double click), try to edit mimeinfo.cache and
remove the faulty application from the list (starting with the local
version of the file). If this is not enough, try removing the entire
mimeinfo.cache file.

Resources
- Good article (albeit old) on the topic
(http://www.ces.clemson.edu/linux/fc4_desktop.shtml#gmime) (in
particular the section on file association
(http://www.ces.clemson.edu/linux/fc4_desktop.shtml#gfass)).
- A Gnome file association editor: assogiate
(http://www.kdau.com/projects/assogiate/): distributed as source. Also
available in Ubuntu Gutsy (Universe) as a package."

Взято на убунту-форуме:
http://ubuntuforums.org/archive/index.php/t-594220.html

П.С. Сам таким же только что образом почистил хлам в меню, прилепленный
вайном. Работает =)

От себя добавлю что мне помогло:
cd ~/.local/share/applications
rm mimeinfo.cache
rm wine-*

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: