Welcome to

John’s Home Page

Quick Extract with Ark

While using Linux I was unhappy that, by default, extracting archives like ZIP files is a multi-step process on KDE Plasma.  But, with the help from some others, I have a fix.

The Problem

I download ZIP files (and other archives) regularly.  But extracting ZIP files on KDE Plasma is a multi-step process, consisting of either:

  • Right-clicking the file, finding the Extract menu, and clicking the Extract Here action.
  • Double-clicking the file to open it with Ark, clicking the Extract button, then clicking the Quick Extract action.

There has to be a faster way!  All I want to do is double-click on a ZIP file and have it automatically extracted.  To do this on Windows I use Bandizip, and on MacOS I use The Unarchiver.

The Solution

Unlike Bandizip and The Unarchiver, Ark doesn't have a simple option to enable the behavior I wanted.  But I found this post about someone who had the same issue.  They solved it using Engrampa which is a different archive program.  Some people on the KDE Matrix server made some suggestions that pointed me in the write direction.

Although Ark doesn't do what I want normally,  it does support a few command line options that can handle it.  The ones I care about are the -b and -a options.

  • -b starts in batch mode and hides the regular Ark window
  • -a extracts the files and automatically creates a subfolder if appropriate.

Knowing this, we can create what's called a .desktop file, which instructs the system how to launch Ark with those parameters.  I modified Ark's own .desktop file as a base and renamed it to Quick Extract.desktop, and saved it to ~/.local/share/applications/.

You can download my version of Quick Extract here.

The only thing left is to make it the default when double-clicking archive files.  In the KDE settings app, go to the Default Applications screen and change the Archive Manager to Quick Extract:

Screenshot of KDE settings screen with new
Setting the Default

Apply the changes and we're golden.  Now, double-clicking (or hitting Enter) on an archive will start extracting the files immediately and show a small progress window.

Screenshot of Ark's progress window extracting an archive.
Progress!

Success!  That was actually pretty easy, and I got to learn more about how modern Linux desktops are put together.  The only thing I'd want to change is to have the newly extract files pop up in a file manager window, but that's a project for another day.

This article was updated on August 15, 2024

Comments