Compress with 7zip to the maximum from Dolphin in KDE (Service Menu)

When we want to compress something we pack it in .tar, .gz, . Bz2 or some combination of these, at least that I have been able to appreciate in most cases. Compress in .zip is something that belongs to the pastI could even include here .ace), while compressing in .rar it is not exactly to our liking, well because .rar It is a non-free format, or any other reason 🙂

The point is that it exists . 7z (7zip) that compresses much more than the aforementioned. When I wanted to compress something to the maximum with 7zip I had to write a command for it, but not anymore, because I made this option in the services menu (right click options) of KDE:

compress-7zip-kde

1. To add this option to our system we must first download the file .desktop:

7zip.desktop

2. We must keep it in $ HOME / .kde / share / kde4 / services / so that it is enabled for our user, or save it in / usr / share / kde4 / services / so that it is enabled for all users of the system. In case the folder $ HOME / .kde / share / kde4 /$ HOME / .kde / share / kde4 / services / it does not matter, you create the missing folder 😉

3. They must have the package installed p7zip-fullp7zip

4. Close Dolphin (file manager) and reopen it, this option should already appear.

When using this option, what is executed in the background is the following:

7za a -t7z -m0=lzma -mx=9 -ms=on %u.7z %f

  • 7za to : To add files
  • -t7z : Specifies that the output file will be .7z
  • -m0 = lzma : Compression parameters, you can read about it here!
  • -mx-9 : We specify that we want to compress to the maximum
  • -ms = on : Solid file
  • % u.7z : Output file, the %u means the path of the file that we want to compress, followed by . 7z We indicate the final compressed file will be created right there where the original is
  • %f : This will be the file or folder that we want to compress
  • So much % u.7z Be %f they are KDE's own parameters, that is, they are not related to Bash or 7za.

To give you an idea of ​​how much 7zip compresses, a dump of the FromLinux database (.sql) weighed 715MB a few weeks ago, compressed with 7zip is only 96MB 😀

Anyway ... I no longer have to be typing a command to compress to the maximum with 7zip, now I can do it from the options menu in Dolphin 😉

I hope this has served you, greetings (I.e.


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

28 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Leper_Ivan said

    Well, two things I have to say ..
    1 ° If I put it in the home folder within the corresponding folder, the item does not appear in the menu, but it does appear if I put it in / usr / share / kde4 / services / ..
    2 ° It is not so much what compresses, unless it did not serve me that way.

    1.    KZKG ^ Gaara said

      About the level of compression, it depends a lot on what you want to compress. For example, if you are going to compress photos or videos ... obviously it will not compress more than a few mb, the multimedia content to compress it must be lowered the quality, that simple.

      Try compressing large text files and you will see 😉

  2.   Samir said

    Thanks, it works great.

    1.    KZKG ^ Gaara said

      A pleasure 🙂
      regards

  3.   Dark purple said

    Ehm ... You don't have to do that to be able to compress in 7zip without using a console. In Dolphin:

    Right click / Compress / Compress in ...

    There the window opens for you to choose where to compress, the name of the file ... And the type, including 7zip.
    Obviously you have to have p7zip-full installed.

    1.    KZKG ^ Gaara said

      Yes indeed, I did not know this option 😀
      But does it fully compress as if it had -mx = 9?

      1.    Dark purple said

        Well, I don't know that. You can do the compression test with both methods and you can tell us.

      2.    Amiel said

        LOL
        Boys, I have done the test several times, with different types of files, pdf, ppt, doc …… .. Look at the compression level is almost the same, -mx = 9 it seems always has a KB advantage… 🙂

        1.    Dark purple said

          Thanks for the info!
          With so little difference I think it is not worth using a console or adding the service, really. I at least stick with the option that Dolphin brings by default.

  4.   dannlinx said

    If I want it to appear instead of actions in the compress menu, how do I do it ??? Should I change this [Desktop Action 7zipc] ??? And why do I get two options in the actions menu, one at the beginning and one at the end?
    PS .: This great thank you very much hehehej

    1.    KZKG ^ Gaara said

      Let do some tests to see how it can be put in the same section 😉

      Thank you for comment.

  5.   mskl said

    KZKG ^ Gaara I think I compressed the dump in that way by the compression theory, if you can do the test with different files, videos, images, documents, to see if it gives a similar result. Anyway, my jaw dropped with the result. Thank you. regards

    1.    sieg84 said

      videos and images are almost always compressed files, there won't be much difference.
      If you want to compress the images more it would be to use WebP and for the videos WebM or something similar / equivalent.

  6.   Amiel said

    Ta weno, it works by the kilo and it's cool as seen in the menu ...

  7.   Snock said

    Good tip

  8.   st0rmt4il said

    Brilliant!

    Thanks man!

    Regards!

    1.    st0rmt4il said

      By the way, looking at the amount of compression, it can be said that the compression ratio is quite wide because you compressed a fairly high amount in MB in only 90x MB.

  9.   Nonamed said

    Interesting

    Thank you

  10.   betsisg said

    Hello excuse me, how could I make it remind me of the directory? for example, service menu that renames a file and its extension to another in the same directory

    1.    KZKG ^ Gaara said

      There are programs for this, KRenamer is one of them, PyRenamer another 😉

  11.   Leper_Ivan said

    I had already seen this and I started it a few days ago while compressing some university files .. It really is very good. For example, I compressed a 101 Mb packet to only 36. It's great!

  12.   Leper_Ivan said

    I am looking at the possibility of integrating a progress bar. Do you have any idea?!

    1.    KZKG ^ Gaara said

      With KDialog you could do something about it ... mmm ... let me see if these days I sit down and think about how to achieve a progress bar or at least a notification 🙂

  13.   Y @ i $ el said

    Good article, very useful by the way.

    1.    KZKG ^ Gaara said

      Thanks to you for commenting 🙂

  14.   Sergio said

    When you want to compress a folder / directory, how is it done?

  15.   Victor juarez said

    Very good information, it would be good if you put how to decompress, to have all the information on one side. Thanks greetings.

  16.   Jairo guevara said

    Complicated for me. There should be an easier way to install this program.