this post was submitted on 16 Oct 2023
576 points (99.0% liked)

KDE

5336 readers
110 users here now

KDE is an international technology team creating user-friendly free and open source software for desktop and portable computing. KDE’s software runs on GNU/Linux, BSD and other operating systems, including Windows.

Plasma 6 Bugs

If you encounter a bug, proceed to https://bugs.kde.org/, check whether it has been reported.

If it hasn't, report it yourself.

PLEASE THINK CAREFULLY BEFORE POSTING HERE.

Developers do not look for reports on social media, so they will not see it and all it does is clutter up the feed.

founded 1 year ago
MODERATORS
 

I hope this doesn't violate the low-quality rule. For those who don't know, when you right click an archive in Dolphin, the extract menu has a "Extract archive here, autodetect subfolder" option and its absolutely brilliant! If you've ever extracted a zip, tar, etc and ended up with files splattered everywhere this feature will prevent that. Basically when you choose this option it will:

  • Look to see if the archive has a top level folder, if it does, it will extract it normally
  • If it does not (so all of the files are at the top level), it will automatically create a folder for the archive and extract those top level files into it

It's something I really wish other file managers had, and is just another one of those features from the KDE team that gives me the "The developer(s) who created this also use this in their daily lives" impression (which is not to say that others don't). You can of course just open your favorite archive utility and manually check, then manually make the folder yourself and extract the files into there, but this lets me skip those couple of steps and I appreciate that so much.

you are viewing a single comment's thread
view the rest of the comments
[–] verysoft@kbin.social 17 points 1 year ago (3 children)

I hate when archives are just a folder inside, now I gotta manually move the files up a level into the directory I wanted them in the first place.

I see this feature is for when there is no folder inside. I come across this a lot less personally.

[–] eager_eagle@lemmy.world 16 points 1 year ago (2 children)

no, no - the opposite is the actual problem: you extract in a non-empty folder and there's no top directory in the archive. Now you have a bunch of files mixed up: the extracted ones and the ones that were there before you did it.

[–] Miphera@lemmy.world 6 points 1 year ago (2 children)

Even better when this happens on a Linux server with no GUI (bonus points if you don't have much Linux experience yet).

[–] russjr08@outpost.zeuslink.net 3 points 1 year ago (1 children)

Honestly now I am curious if there is a CLI equivalent. I always end up using tar's t flag or opening a zip in vim to see if it has a subfolder as my current workaround...

[–] Qyriad@chaos.social 1 points 1 year ago (1 children)

@Miphera @russjr08 you might want to look into atool's aunpack command

[–] russjr08@outpost.zeuslink.net 1 points 1 year ago

Oh this looks fantastic! I will be deploying this to all of my systems immediately haha!

[–] elint@programming.dev 0 points 1 year ago (1 children)

You get Linux experience real quick when you make mistakes like that in a shell with no GUI.

mkdir newfolder; find . -maxdepth 1 -mmin -5 -exec mv "{}" newfolder \;

[–] Andy@programming.dev 1 points 1 year ago

If you'll forgive my compulsion to substitute all finds with Zsh globs:

$ for f ( ^(newfolder)(mm-5) )  mv -i $f newfolder/

Assumed:

$ mkdir -p newfolder
$ setopt extendedglob
[–] verysoft@kbin.social 3 points 1 year ago* (last edited 1 year ago)

Ahaha yeah, it'd be fine if it was always either way for me, but I personally prefer setting my folder up and then extract the archive into there, so I don't have to rename it or whatever after extracting. So I would rather it have all the files in the top of the archive and not in a folder.

[–] russjr08@outpost.zeuslink.net 5 points 1 year ago

That's perfectly fair! I always seem to have a 50/50 coin toss of whether there will be a folder inside the archive or not.

I think if things were more consistent for what I end up having, I wouldn't mind it if archives didn't have a folder or if they always had a folder, rather than the current state.

I suppose in your case, it would be cool if there were a config option to make this do the reverse, unpack the files within the subdirectory of the archive to your current directory.

[–] omidmnz@lemmy.world 5 points 1 year ago

The "autodetect subfolder" option handles both scenarios fine. This is actually what makes it useful! If I remember correctly, when there's a single file or folder inside, it just extracts, otherwise it makes a folder with the same name as the archive without the extension.