• Re: [gentoo-user] Dolphin and extracting archives, .zip at the moment.

    From eric@21:1/5 to Dale on Mon Jan 13 05:00:01 2025
    On 1/12/25 20:03, Dale wrote:
    Howdy,

    I think I ran into this on my old rig too.  After some upgrade, I lost
    the option in the right click menu.  I have this issue on the new rig
    and can't find anything to install that makes it work again.  I
    sometimes download archives.  Right now, I have a lot of .zip files.
    I'd like to be able to right click and chose extract here or extract to sub-directory.  I looked in Settings and Context for Dolphin and
    installed everything I could find for archives but still nothing.  I
    also looked to see what all was installed with emerge for this feature.
    It looks like I have them all installed.  This is the list of installed packages on the system.


    root@Gentoo-1 / # equery list *zip*
     * Searching for *zip* ...
    [IP-] [  ] app-alternatives/bzip2-1:0
    [IP-] [  ] app-alternatives/gzip-1:0
    [IP-] [  ] app-arch/7zip-24.09:0
    [IP-] [  ] app-arch/bzip2-1.0.8-r5:0/1
    [IP-] [  ] app-arch/gzip-1.13-r1:0
    [IP-] [  ] app-arch/p7zip-17.05-r1:0
    [IP-] [  ] app-arch/unzip-6.0_p27-r1:0
    [IP-] [  ] app-arch/zip-3.0-r7:0
    [IP-] [  ] dev-libs/libzip-1.11.2-r1:0/5
    [IP-] [  ] virtual/perl-Compress-Raw-Bzip2-2.212.0:0
    root@Gentoo-1 / #



    In Dolphin, I've enabled and installed everything I can find related to
    any archive.  They are also all checked to enable.  Still, the right
    click menu no longer shows the option to extract .zip or other types
    I've ran into in the past.

    What is the proper tool to install for this?  What am I missing?  I find
    it hard to believe that this is no longer a option given the vast
    majority of people do this sort of thing in a GUI nowadays.  I have to
    be missing something.

    Thanks.

    Dale

    :-)  :-)


    Hi Dale,

    Do you have "Ark" installed? I think that is the archive tool plasma
    uses by default. In a post on stack exchange installing Ark worked for
    one person to give dolphin the right click option to extract archives.

    https://stackoverflow.com/questions/69849444/extract-here-context-menu-item-for-dolphin-file-manager

    Eric

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Mon Jan 13 09:10:45 2025
    On Monday 13 January 2025 04:47:39 Greenwich Mean Time Dale wrote:
    eric wrote:
    On 1/12/25 20:03, Dale wrote:
    Howdy,

    I think I ran into this on my old rig too. After some upgrade, I lost
    the option in the right click menu. I have this issue on the new rig
    and can't find anything to install that makes it work again. I
    sometimes download archives. Right now, I have a lot of .zip files.
    I'd like to be able to right click and chose extract here or extract to
    sub-directory. I looked in Settings and Context for Dolphin and
    installed everything I could find for archives but still nothing. I
    also looked to see what all was installed with emerge for this feature.
    It looks like I have them all installed. This is the list of installed
    packages on the system.


    root@Gentoo-1 / # equery list *zip*
    * Searching for *zip* ...
    [IP-] [ ] app-alternatives/bzip2-1:0
    [IP-] [ ] app-alternatives/gzip-1:0
    [IP-] [ ] app-arch/7zip-24.09:0
    [IP-] [ ] app-arch/bzip2-1.0.8-r5:0/1
    [IP-] [ ] app-arch/gzip-1.13-r1:0
    [IP-] [ ] app-arch/p7zip-17.05-r1:0
    [IP-] [ ] app-arch/unzip-6.0_p27-r1:0
    [IP-] [ ] app-arch/zip-3.0-r7:0
    [IP-] [ ] dev-libs/libzip-1.11.2-r1:0/5
    [IP-] [ ] virtual/perl-Compress-Raw-Bzip2-2.212.0:0
    root@Gentoo-1 / #



    In Dolphin, I've enabled and installed everything I can find related to
    any archive. They are also all checked to enable. Still, the right
    click menu no longer shows the option to extract .zip or other types
    I've ran into in the past.

    What is the proper tool to install for this? What am I missing? I find >> it hard to believe that this is no longer a option given the vast
    majority of people do this sort of thing in a GUI nowadays. I have to
    be missing something.

    Thanks.

    Dale

    :-) :-)

    Hi Dale,

    Do you have "Ark" installed? I think that is the archive tool plasma
    uses by default. In a post on stack exchange installing Ark worked for
    one person to give dolphin the right click option to extract archives.

    https://stackoverflow.com/questions/69849444/extract-here-context-menu-ite m-for-dolphin-file-manager


    Eric

    That seems to be the thing I was missing. I was running out of hair
    over here. LOL Once I installed that, the option appeared. I didn't
    even have to restart Dolphin. I did notice there is no option to
    extract to a sub-directory tho. May have to look into that some more.
    May be a option or something.

    Thanks much.

    Dale

    :-) :-)

    Ark is brought in by kde-apps/kdeutils-meta as a dependency. Have you not installed kde-apps/kdeutils-meta?
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmeE2JUACgkQseqq9sKV ZxlcsBAAmlqW/BMvU5fy/Lxq4jPvW3f0GmOwO+JxqOVEeH4zoJ87ivJGQjykq+B1 HfIcURlLf1MGKfgpmOrh1m4x7xcZM4O/o1hdL8QecRLVTCaMDVa3MrXnGIrNKczO SzCrKD84BhDMsIu8s1zgJ+x/BmpKsed8YMPVcvJ7w0LTYcLsOzYm9j5ImzmAY+5f c9kZHptu3VYiqS71D3KFrwAqkR0wWhb8s6BYsWT61p6R6wK2dbVaI/ihflY0sJBw rYBFKD9tk/mXCLcyQv0mDieOqB+k2cRGn1UhJtRNeJBd0sJSeiNsI9OFHLv/orxC n6Cd+hlzWxPZveQIo6j9ZdDIPqDp9uC9NfRa7gw0qMw5ryd7QjEjke7eTXc6tz8+ YclCXwzScTYXjHw+4SC7E9PiQszppe2PkG/egde7KWFjIvpsLRihv7pZjCgE9Pep orA4WViqA5cbIE4vXTT8hFCuyW5pgQaC1WOBSAwALb2ogIK5gmiCqGOsIXdRkC+k gnEBQmaJfDje0hEYuaEIOtAdq6lHjClxkDW1zNev+TWcXQ0ZajUjBNDJ1cyWEWSt JfQs+/MO7LuutAMLn9/O2q/becrkh8q8KER9rohP4h9x/bfqmt6D2MtfK4kcob03 T6fpDVQhWLYVVI9v1M7llCsD/GMiZeNI81U1rMyuKXhqfgIKZrc=
    =tsqu
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Mon Jan 13 18:37:35 2025
    On Monday 13 January 2025 14:17:41 Greenwich Mean Time Dale wrote:
    Michael wrote:
    On Monday 13 January 2025 04:47:39 Greenwich Mean Time Dale wrote:
    eric wrote:
    On 1/12/25 20:03, Dale wrote:
    Howdy,

    I think I ran into this on my old rig too. After some upgrade, I lost >>>> the option in the right click menu. I have this issue on the new rig >>>> and can't find anything to install that makes it work again. I
    sometimes download archives. Right now, I have a lot of .zip files. >>>> I'd like to be able to right click and chose extract here or extract to >>>> sub-directory. I looked in Settings and Context for Dolphin and
    installed everything I could find for archives but still nothing. I >>>> also looked to see what all was installed with emerge for this feature. >>>> It looks like I have them all installed. This is the list of installed >>>> packages on the system.


    root@Gentoo-1 / # equery list *zip*

    * Searching for *zip* ...

    [IP-] [ ] app-alternatives/bzip2-1:0
    [IP-] [ ] app-alternatives/gzip-1:0
    [IP-] [ ] app-arch/7zip-24.09:0
    [IP-] [ ] app-arch/bzip2-1.0.8-r5:0/1
    [IP-] [ ] app-arch/gzip-1.13-r1:0
    [IP-] [ ] app-arch/p7zip-17.05-r1:0
    [IP-] [ ] app-arch/unzip-6.0_p27-r1:0
    [IP-] [ ] app-arch/zip-3.0-r7:0
    [IP-] [ ] dev-libs/libzip-1.11.2-r1:0/5
    [IP-] [ ] virtual/perl-Compress-Raw-Bzip2-2.212.0:0
    root@Gentoo-1 / #



    In Dolphin, I've enabled and installed everything I can find related to >>>> any archive. They are also all checked to enable. Still, the right >>>> click menu no longer shows the option to extract .zip or other types >>>> I've ran into in the past.

    What is the proper tool to install for this? What am I missing? I
    find
    it hard to believe that this is no longer a option given the vast
    majority of people do this sort of thing in a GUI nowadays. I have to >>>> be missing something.

    Thanks.

    Dale

    :-) :-)

    Hi Dale,

    Do you have "Ark" installed? I think that is the archive tool plasma
    uses by default. In a post on stack exchange installing Ark worked for >>> one person to give dolphin the right click option to extract archives. >>>
    https://stackoverflow.com/questions/69849444/extract-here-context-menu-i >>> te
    m-for-dolphin-file-manager


    Eric

    That seems to be the thing I was missing. I was running out of hair
    over here. LOL Once I installed that, the option appeared. I didn't
    even have to restart Dolphin. I did notice there is no option to
    extract to a sub-directory tho. May have to look into that some more.
    May be a option or something.

    Thanks much.

    Dale

    :-) :-)

    Ark is brought in by kde-apps/kdeutils-meta as a dependency. Have you not installed kde-apps/kdeutils-meta?

    I hadn't but I have now. While I got the option back, it isn't working
    like it used too. The way I used to do it, I select extract to sub directory.

    It does this by default when you select to 'Extract here'. For example, the archive foo.zip will be extracted into a new directory called foo/ and all compressed files in foo.zip will be extracted into foo/.

    If you do this a second time, it will create a new directory foo(1)/ and extract the compressed files in there so as to not overwrite the previously extracted files in foo/.


    That comes in handy when you have lots of .zip or .tar files
    to extract. What it does is create a new directory with the same name,
    less the extension, as the original .zip or .tar file and then puts the extracted files inside that directory. It repeats for every .zip file.
    On this new thing, I selected Extract to and in the next window I
    selected Extraction into subfolder. Thing is, if I have more than one
    .zip file, it puts ALL the contents of ALL .zip files into ONE
    directory, overwriting/renaming etc duplicates. That's not what I
    want. I did a search, I found someone else with the same complaint. I didn't find a proper way to accomplish the same thing it used to do tho.

    You can type in what you want to call the new subdirectory (options shown in top right of the pop up) so as to not overwrite existing subdirectories/files.

    I tried to figure out how to do this on the command line but my head
    hurts. Banging that wall isn't any fun.

    I don't think a single command can achieve this. Unzip will ask if you want
    to overwrite files already extracted in a previous attempt and it will create
    a directory to store the extracted files if one does not exist, but it will
    not ask to rename an existing directory.


    Anyone been able to figure out how to do this? I got a few hundred .zip files and doing them one by one just isn't a good option.

    Dale

    :-) :-)

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmeFXW8ACgkQseqq9sKV ZxlPMRAAwwQfUKVLZ0823/lsk0q4Z0G8h93pRFQ6iuOp4+TF1Ekx8m170xZB2rBs lmZ3O6gRCAXyBGLmtxsMozyGtAz+PyCheAt8YCSon6BHl/uNYZIHdor15SJCGD6h fOpYm1RBMslvJbRJO2zSjoeT7XO0qUXGHPz0eCCq70F6DpIPZ5u9fC86N/rik1Ec /OnPg+tzNxLedbQxcks/d0a23CD6ez20NXR8YHlJpio6HZDkMW4kOhnErhU0Mhz6 aC+IZjFs06AG1F7yKzkuYh8hrwIBt5YlQJ4UV4QNfd4rAivTUuvKXPdJQNsLvKdc cy614vHhRygFf5zyxBQfZHJ2DD4Vm5ONOKQhTZBu8Xr+78Qb0nXzMaMsYIXl/Mt5 u5k2dqcPW+I1M67ujeIQSLeZJmRpdGRyvWkHWJRORpE+J/2acGWv6ifBIPndyred 3kKjh1k8hdGFhQCU6k/Ip1xzX6C0WPqN5k0n4O/JHxiZTCjDoDYQRq+zyw05sTxE XMEYlA20FeomXieNplx6KNponDe0PrBMhCujHOl17z67ljM9wcoOu87yoP+lafHX 0sMQXWBga0jlyxkirLYfoNrgYQqlmm4+nXlxTr5KkoL0wHgxgEjj9FJajEotmRjT vyAMmSyzBh7o/SkEbsjtLjqPw7pdmjRNG9pLCF82HCac4OVNeI0=
    =e428
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Steinmetzger@21:1/5 to All on Tue Jan 14 17:00:01 2025
    Am Tue, Jan 14, 2025 at 07:06:16AM -0600 schrieb Dale:
    Michael wrote:
    On Monday 13 January 2025 14:17:41 Greenwich Mean Time Dale wrote:

    It does this by default when you select to 'Extract here'. For example, the
    archive foo.zip will be extracted into a new directory called foo/ and all compressed files in foo.zip will be extracted into foo/.
    […]

    That seems to work like the old way.  I guess the default changed but it didn't make sense given how it used to work. 

    I thought it would behave like you expected – always create a subdir for each ZIP. I could reproduce that it does not. So I looked at Ark’s settings: there is an option to create a subdirectory for a ZIP as soon as the zip contains more than one item. So it is still there, but not for every file.

    I tried to figure out how to do this on the command line but my head
    hurts. Banging that wall isn't any fun.
    I don't think a single command can achieve this. Unzip will ask if you want
    to overwrite files already extracted in a previous attempt and it will create
    a directory to store the extracted files if one does not exist, but it will
    not ask to rename an existing directory.


    Anyone been able to figure out how to do this? I got a few hundred .zip >> files and doing them one by one just isn't a good option.

    Dale

    :-) :-)


    I figured if there was a command line way, it would require sed, awk,
    find and other things I don't understand.

    Don’t give one-liners more credit than they’re due. All you need is a for-loop over all ZIP files, calculate an ouput dir by removing the trailing “.zip”, and finally call unzip with both:

    for z in *.zip; do unzip "$z" -d "${z%.zip}"; done

    If you want to be smart, omit the extraction if the output directory already exists, to avoid overwriting stuff:

    # for-loop: cut off ".zip" does dir exist? yes no
    for z in *.zip; do d="${z%.zip}"; [ -d "$d" ] && echo "Skipping $z" || unzip "$z" -d "$d"; done

    --
    Grüße | Greetings | Salut | Qapla’
    Please do not share anything from, with or about me on any social network.

    ...llaw eht no rorrim ,rorriM

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)