How to action menu entry in Dolphin.

Feb 10th, 2010 | Filed under Uncategorized

Peace of simpleĀ  functionality I’ve been lacking for some time in dolphin was “send to ” option which would create an email with attached file(s). I have no idea why it does not exists “out of box” but there is quite simple way of adding this.

This descriptions applies to KDE4.
/usr/share/kde4/services/ServiceMenus

contains list of actions avaiable in Dolphin for various file types.
If you add file there an entry will appear in Dolphin (Settings -> Configure Dolphin, Services)
In order to Dolphin re-read content of this dir you have to change something in that windows (check and uncheck any selectbox and press apply).

Ok. create email.desktop in mentioned dir:

[Desktop Entry]
Actions=attachToEmail
Encoding=UTF-8
ServiceTypes=KonqPopupMenu/Plugin,all/allfiles
ExcludeServiceTypes=application/x-iso,kdedevice/*,inode/directory
Type=Service

[Desktop Action attachToEmail]
Name=Attach to Thunderbird Mail
Name[en]=Send file as attachment
Name[]=Wyslij jako zalacznik
Icon=/usr/share/thunderbird/icons/mozicon16.xpm

[Desktop Entry]
Actions=attachToEmail
Encoding=UTF-8
ServiceTypes=KonqPopupMenu/Plugin,all/allfiles
ExcludeServiceTypes=application/x-iso,kdedevice/*,inode/directory
Type=Service

[Desktop Action attachToEmail]
Name=Attach to Thunderbird Mail
Name[en]=Send file as attachment
Name[]=Wyslij jako zalacznik
Icon=/usr/share/thunderbird/icons/mozicon16.xpm
Exec=thunderbird -compose “attachment=’file:/`echo %F | sed ‘s/\\ \\//,file:\\/\\//g’`'”

Download above sample from here.

As you see you can specify with which file types this context menu should appear.
Above configuration works for thunderbird 2.x (2.x requires files:// prefix, because of some bug)

There is a peace of magic in Exec line, because of the way thunderbirds expects filenames.

More about desktop file format here.

No comments yet.

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image