Compress and Attach

Dolphin Service Menus

Source (required if based on other people's work):

0
Score 60%
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:

8 years ago

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

itsjustarumour2

6 years ago

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.

Report

nusch

7 years ago

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'

Report

C

danux

7 years ago

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!

Report

nusch

7 years ago

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

Report

nusch

7 years ago

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

Report

C

danux

7 years ago

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 ;)

Report

taelas

9 years ago

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

Report

C

danux

9 years ago

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

Report

Contrast

9 years ago

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).

Report

C

danux

9 years ago

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...

Report

Okanda

9 years ago

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?

Report

C

danux

9 years ago

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

Report

8 years ago

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

product-maker 6 12

File (click to download) Version Description Packagetype Architecture Downloads Date Filesize DL OCS-Install
Pling
Details
license
version
1.1
updated Sep 17 2010
added Apr 14 2009
downloads today
0
page views today 0
System Tags addon