FileManager

FileManager

The idea behind this project is to integrate the Windows shell API with the Linux file managers (Nautilus/Konqueror). Ideally, we should be able to install WinZip or Vim for Windows and have them appear automatically in the right hand menu of your favorite file manager, just as they do in the Windows Explorer.

Nautilus

Context menu item

From section 6.3 "Context menu item" of http://developer.gnome.org/doc/whitepapers/nautilus/nautilus-internals.html

If you want to integrate an application with the file manager you can install a context menu component for a particular file type. This will add a menu item in the context menu for files in the icon and list views that lets you launch your application on the file(s). The name of the menu item can be translated.

This works by installing a component in bonobo-activation that has a boolean attribute called nautilus:context_menu_handler set, and optionally a nautilus:can_handle_multiple_files attribute. When the other normal attributes of the component (bonobo:supported_mime_types, bonobo:supported_uri_schemes, etc) matches the files selected when the context menu is showed, all the attributes starting with nautilusverb: are read and put into the context menu.

The attributes can look like this: (the attributes with underscores will be translated by intltool): <oaf_attribute name="nautilusverb:DoExtract" type="string" _value="Extract To..."/>

When the context menu item is selected the component will be activated, and the Bonobo::Listener::event() method will be called with a sequence of the selected URIs as arguments.

Examples of how to implement context menu plugins are available in file-roller, nautilus-cd-burner and fontilus.

Konqueror

From: http://developer.kde.org/documentation/tutorials/dot/servicemenus.html

you only have to create a .desktop file (who describe menu entry) on <global or user kdedir>/share/apps/konqueror/servicemenus/

One Example (ark_directory_service.desktop on my computer where I have removed most of the translations):

[Desktop Entry]
Encoding=UTF-8
ServiceTypes=all/all
Actions=create_targz;create_tarbz2;create_zip

[Desktop Action create_targz]
Name=Create gzipped tar Archive
Name[fr]=Créer une archive gzip
Name[pt]=Criar um Pacote tar/gzip
Icon=ark
Exec=ark --add --add-to .tar.gz %U

[Desktop Action create_tarbz2]
Name=Create bzipped tar Archive
Name[fr]=Créer une archive tar bzipé
Name[pt]=Criar um Pacote tar/bzip
Icon=ark
Exec=ark --add --add-to .tar.bz2 %U

[Desktop Action create_zip]
Name=Create zip Archive
Name[fr]=Créer une archive zip
Name[pt]=Criar Arquivo zip
Icon=ark
Exec=ark --add --add-to .zip %U

You can specify mime-types using ServiceTypes key:

[Desktop Entry]
Encoding=UTF-8
ServiceTypes=application/ogg,audio/vorbis,audio/x-mp3,audio/x-flac,audio/x-oggflac,audio/x-musepack

FileManager (last edited 2008-05-03 00:28:22 by nathan.n)