Compress and Attach
Source (link to git-repo or to original if based on someone elses unmodified work):
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!
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
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.
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'
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!
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
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 ;)
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
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
Thank you for the translation. I have corrected de tildes problem, tnx...
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).
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...
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?
Maybe you haven't RAR installed? Be sure to install it first (attention: be sure you have rar, because unrar is only to decompress)