Compress and Attach

Dolphin Service Menus

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Description:
It's a simple script that allows you to right-click on any file, group of files or directory to compress it and send it by email. I used zip rather than gzip or bz, because it's more MS familiar (if you send mails to MS users). It is configured for it's use WITH THUNDERBIRD ONLY. Maybe in future versions (with help of somebody) I can add more mail clients but I don't know how to look for the default mail client.
I'm accepting more translations too (now it comes in Spanish, German, Polish, Czech, French, Russian and English).


Se trata de un script muy sencillo que te permitirá comprimir un archivo, un grupo de archivos o un directorio y enviarlo por correo electrónico. Usé el compresor zip porque es más universal (sobre todo si tienes contactos de usuarios de MS). Está configurado para funcionar únicamente con THUNDERBIRD. Talvez añada algunos otros clientes a futuro (si alguien me ayuda), sobre todo a saber como hacer un script que reconozca el cliente de mail predeterminado.
También estoy aceptando más traducciones (por ahora se encuentra sólo en inglés, alemán, polaco, checo, francés, ruso y castellano).


Instalation:
on shell run "kde4-config --path services"

Put the .desktop file in this directory and restart Dolphin or Konqueror

Fully tested to work under TB 3.0.7, KDE 4.5, Mandriva 2010.1, 64bits architecture. If you use other systems and architectures, please report if it succeeded!
Last changelog:

From version 0.8 to 1.0:
- Fixed the folder issue. Now it compress the files without the folders from the root.
- Change rar compression method to zip (=moore compatibility)
- Added translations to French (thank you Okanda) and to German, Polish and Czech (thank you poppei)
- Changed the temporary directory from ~/tmp to /tmp (wich should be present and writable in most distros). This makes the script a bit moore distro compatible.

From version 1.0 to 1.0.1:
- Removed some tildes
- Added russian translation

From version 1.0.1 to 1.2:
- Moved to Thunderbird 64 bits.
- Changed icon


Ratings & Comments

12 Comments

itsjustarumour2

Not working for me on Ubuntu 12.04 KDE 4.8.1 (32-bit) with Thunderbird 11.0. I have rar, unrar, zip, unzip, g7zip etc installed.

nusch

is also wrong: it should be: -Kompresować a posłać +Kompresuj i wyślij -Gotowy +Gotowe I would also suggest instead kdialog --mesagebox Ready use of: kdialog --title 'Compress and attach' --passivepopup "%U\nCompression finished" 3 Also I removed the sed in my version, I don't know what it should do at all because now it returns error, while whole script work without it: nusch@novopad:~/tmp$ echo ~/tmp/attach.zip | sed 's/\\ \\//,file:\\/\\//g' sed: -e expression #1, char 10: unknown option for `s'

danux

Ok, thank you for the corrections... I had to add the sed command to allow multiple files selection for the compression. If it works in your box, it's fine!

nusch

It works fine for both single file/directory and multiple. But with sed parsing it throws error mentioned and doesn't pass further to 'thunderbird --attach..' I'm also wondering why did you used -D option passed to zip - if we compress e.g. source code of program organized into directories, after this all files will come to one. I think better solution to not include root directory will be something like this inside script: #!/bin/bash echo "%U" to_compress=%U; if [ -d $to_compress ]; then to_compress=`ls` fi echo $to_compress

danux

You have good ideas but I was really looking for a simple solution to this task, so if possible, I'll avoid the use of a second file containing the script. The filename is a challenge, because you can do it by use ark and the parameter --autofilename. The problem is make the servicemenu find the file to attach it... I guess I'll have to do some trys ;)

nusch

also it would be great if archive could be named after files - like filename.zip, dir name if dir selected or parent dir name if multiple file selected, I think it's already implemented in: /usr/local/bin/compress_ZIP.sh from http://kde-look.org/content/show.php?content=84206

taelas

please, remove tildas not only from english version russian translation: Name[ru]=Упаковать и отослать Exec[ru]=zip -rDj /tmp/attach.zip %U && kmail --composer --subject="Высылаю вложенный файл" --attach /tmp/attach.zip && kdialog --msgbox Готово && rm -f /tmp/attach.zip

danux

Thank you for the translation. I have corrected de tildes problem, tnx...

Contrast

Tying it down to only use RAR is quite limiting. Most of the people I would be e-mailing attachments to use Linux, and even those still on Windows will have just as easy a time opening a .zip or .7z file (both Free formats) as they would a .rar (which is proprietary).

danux

So you suggest using zip? It's a good idea, but I will have to explore it (never used zip compression, never needed it)... Maybe next version comes with both rar or zip compression. If you could help me with some zip compression commands, it would be great. Thank you all for your ideas...

Okanda

Hello. This service-menu could be very useful to me. I install it in ~/.kde/share/kde4/services/ But when I choose "Compress and Send" in the menu nothing happen! Any idea about the problem?

danux

Maybe you haven't RAR installed? Be sure to install it first (attention: be sure you have rar, because unrar is only to decompress)

Pling
0 Affiliates
Details
license
version 1.1
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

More Dolphin Service Menus from danux:

Attach to thunderbird
danux
last update date: 11 years ago

Score 7.0

Remove Special Characters
danux
last update date: 16 years ago

Score 5.0

Other Dolphin Service Menus:

burnWithGrowisofs
chunkylover
last update date: 20 years ago

Score 5.0

Firefox-bookmarks service menu
storyteller
last update date: 20 years ago

Score 5.0

Text Convert Service Menu
smp-penguin
last update date: 21 years ago

Score 5.0

Pdflatex servicemenu
bobuse
last update date: 19 years ago

Score 5.0

Send through Bluetooth
dmnet
last update date: 20 years ago

Score 5.0

Add to Bloglines
spookster
last update date: 20 years ago

Score 5.0



System Tags