Every dog has a blog!
[ start | index | login or register ]
start > 2010-01-02 > 1

Context Menu (ServiceMenu) in KDE4 for "Send as e-mail"

Created by derjohn. Last edited by derjohn, 3 years and 169 days ago. Viewed 1,294 times. #1
[edit] [rdf]
labels
attachments

Context Menu (ServiceMenu) in KDE4 for "Send as e-mail"

Quite often I send multiple files via e-mail. My Desktop is driven by KDE4 and I use Icedove (Thunderbird) as Mail-Client. Sadly in KDE4 there is no context menu in the file-manager (dolphin / konqueror) that give the functionality to create archive of multiple files on the fly and send the achive as e-mail.

So I created a KDE4 ServiceMenu file in /usr/share/kde4/services/ServiceMenus/sendwithicedove.desktop

[Desktop Entry] Type=Service ServiceTypes=KonqPopupMenu/Plugin,all/allfiles,inode/directory ExcludeServiceTypes=kdedevice/* Encoding=UTF-8 Actions=sendwithicedove;sendtargzwithicedove;sendzipwithicedove;

[Desktop Action sendwithicedove] Exec=icedove -compose "$( echo -ne "subject=Attachments,body=Files:n"; for i in $(echo %F); do echo ' '$(basename ${i}); done; echo -n ",attachment='"; for j in $(echo %F); do echo -n file://${j},; done; echo "'";)" Icon=icedove Name=Send as E-Mail Attachment (Icedove) Name[de]=Als Anhang per E-Mail senden (Icedove)

[Desktop Action sendtargzwithicedove] Exec=icedove -compose "$( echo -en "subject=tar.gz-file: archive.tar.gz,body=Content:n"; for i in $(echo %F); do echo ' '$(basename ${i}); done; mytmpdir=$(mktemp -d --tmpdir sendtargzwithicedove-XXXXXXXXXXXX); tar czf ${mytmpdir}/archive.tar.gz --transform='s#^.*/##' %F 2> /dev/null; echo -n ',attachment=file://'${mytmpdir}'/archive.tar.gz'; )" Icon=icedove Name=Send as tar.gz Attachment E-Mail (Icedove) Name[de]=Als tar.gz-Anhang per E-Mail senden (Icedove)

[Desktop Action sendzipwithicedove] Exec=icedove -compose "$( echo -en "subject=zip-file: archive.zip,body=Content:n"; for i in $(echo %F); do echo ' '$(basename ${i}); done; mytmpdir=$(mktemp -d --tmpdir sendzipwithicedove-XXXXXXXXXXXX); zip -9qjr ${mytmpdir}/archive.zip %F 2> /dev/null; echo -n ',attachment=file://'${mytmpdir}'/archive.zip'; )" Icon=icedove Name=Send as zip Attachment E-Mail (Icedove) Name[de]=Als zip-Anhang per E-Mail senden (Icedove)

(If you are using Thunderbird, then you must replace icedove with thunderbird manually)

It provides there menuitems the dolphins and konquerors context (right-click) menu:

  • Send as E-Mail Attachment (Icedove)
  • Send as tar.gz Attachment E-Mail (Icedove)
  • Send as zip Attachment E-Mail (Icedove)
The script has some disadvantages:
  • It doesn't clean up the /tmp directory: It can't to, becuase the archive must say there until the user really send the e-mail.
  • It does store directories recursively, but the file-list in the e-mail body only list the directory and not the files within (Hereby I define this as feature :-))
no comments | post comment

< June 2013 >
SunMonTueWedThuFriSat
1
2345678
9101112131415
16171819202122
23242526272829
30


Logged in Users: (1)
… and 2 Guests.

Blogrolling:
>>Blog des Wahnsinns
>>Daniel Holbach's Blog
>>Matt Cutt's blog
>>Randgruppentourismus

XHTML 1.0 validated
CSS validated
RSS 2.0 validated
RSS Feed

Hinweise zur Formatierung
snipsnap-help.

Powered by
SnipSnap 1.0b1-snipit

Ads will be placed here!

dem john sein blog | Impressum: Andreas John, Frankfurter Str. 98a, 63067 Offenbach, E-Mail: himself@derjohn.de