Unzip archive by double-clicking in Zorin 17 Core/Lite and 18 Lite

In Zorin 18 Core, you just need to doubleclick to extract an downloaded archive, e.g. .zip file.

How can this be setup in Zorin 17 for Thunar (the default file manager of Zorin Lite) and Nautilus (the default file manager of Zorin Core)?

You can right-click on the archive file and select "extract here", but I'd like to know if it can be opened in background by doubleclicking (without opening a window where you have to select "unzip").

For Thunar I found a solution now:

Right-click on the archive, select "set default application", and then select "use a custom command" and enter this command:

file-roller -h

Also check the box "use for file type by default".

Do this for all archive types.

I read, that it is not as safe and you should check archives for malware before extracting.

Edit: After setting the custom command in Thunar, I was able to select file-roller -h as default application for Nautilus and it worked there, too.

If you have Thunar not installed, you can copy the .desktop fille of fileroller from
/usr/share/applications/org.gnome.FileRoller.desktop
to
~/.local/share/applications
and edit it.

Change the following (and keep the other lines):

Name=Archive Manager Modified
Exec=file-roller -h %U

and save the file with another file name (org.gnome.FileRoller-modified.desktop)
at ~/.local/share/applications.

Then set the Archive Manager Modified as default application for the archive files.
Right-click on the archive, select properties and at tab "open with" select Archive Manager Modified. Then click on "set as default".

1 Like

That is why when using Windows I preferred 7-zip as it gave you multiple choices on right-click.

An alternative method to do the same:

Open alacarte (Zorin Core) or menulibre (Zorin lite) - you can instead also right-click on the Zorin start menu icon and select "edit menu" - and then create a new launcher.

As name choose a name you like, e.g. Archive Manager Modified, and as command file-roller -h %U
Also set an icon you like.
It looks so:

Zorin Core:

Zorin lite:

Then save your new launcher entry and right-click on your archive file > properties and set the Archive Manager Modified as default to open the file type.

1 Like

Shouldn't this work, when You choose here:

Thunar?

Then the archive manager is opened, but you have to confirm that you want to extract/unzip the file. It does not do it automatically. I am glad, that I found a solution now, because I found it not as comfortable as in Zorin 18.

Hm. I am not sure, if I understand you right. When I set Thunar as default for the archive file, Thunar is opened normally at the directory of the downloaded archive file, e.g. Downloads. But I searched for a solution for the Zorin 17 Core users which do not have Thunar installed.
Edit: Ah, I see, why you have asked this. In Zorin 18, for many archives nautilus is set as default application and unzips the archives automatically. In Zorin 17, that doesn't work.

I'm wondering why extracting in Nautilus is faster with a right-click > extract here, than with doubleclicking. I thought, it are the same commands, or not?

1 Like

I'd like to find out what the default command is in Zorin Lite (Thunar) and Zorin Core (Nautilus) in the context menu > extract here.

How can I find the file which sets the code for that context menus in Nautilus and Thunar?

I'm wondering if it is better to set a custom unzip command instead of a file-roller command.

Hm.. there seem not to exist such files where you can see the commands of the default context menu entries. They seem to be hard coded into the file managers.

1 Like

I'd like to assign all file types that are opened by default with File-Roller to the custom File-Roller-Modified .desktop file. How do I do that?

Edit: I replaced all org.gnome.FileRoller.desktop terms
at
/usr/share/applications/defaults.list
with the name of my custom desktop file (org.gnome.FileRoller-modified.desktop or - when created with alacarte or menulibre, take a look at ~/.local/share/desktop what the file is named, e.g. alacarte-made.desktop).

It didn't help to unzip all archives automatically by double-clicking.
It seems, file-roller is not set for all archives.
E.g. I downloaded the tarball of firefox to test, and it was not unzipped by a double-click, so the default application to open the tar.xz needed to be set separately.

I'm not sure if it would be better to copy the content of the defaults.list into the mimeapps.list at ~/.config
and edit it there (to avoid a system-wide change and avoid possible changes by updates).
I'd really like to know how, for example, to include all the different .tar archives in the mimeapps.list.

That is because there are not directly the same . You have .tar, tar.xz, tar.gz which is treated as different Archives.

How can I add all various .tar archives or all compressed files with one line (placeholder * or similar)? I don't know which variants exist.

Good Question. To be honest I don't know. I use the Archive Manager for compressed Files. and I use mostly the same Types. And that, I have set up manually over Right-Click if neccessary.

1 Like

Yeah, you're right - it are usually the same file types over and over again. It doesn't take much effort to set the default app. I was just curious to see how something like that would work.

@Aravisian Why is Nautilus so much faster at extracting files by double-clicking in Zorin 18 than in Zorin 17 or than Thunar in Zorin 17/18?
Is a custom command or a default application to open it slower than a built-in tool (in Zorin 18 core, Nautilus is set as default application to open many archives, not file-roller)?

Edit: Hm, ...it seems you can make Thunar in Zorin 17/18 Lite faster extracting files by double-clicking.
You can set as custom command a command line tool instead of file-roller, and then it is much faster and extracts archives immediately by double-clicking.
E.g. I set for the .zip files "unzip %f" and for the .tar.xz files "tar -xf %f", and it is very fast, even faster than with the right-click context menu "extract here".
The downside is that you have to use different commands for the various archive file formats.

So I looked around for other options. The command-line program atool (sudo apt install atool) seems to work quite well for various file types when you use the command "aunpack %f," but it often extracts files into a directory it creates itself. I still need to figure out how to get it e.g. to extract .tar.gz files directly into the Downloads folder, for example, rather than into Unpack-...

The command line tools unzip, tar, atool seem not to work in Nautilus, only in Thunar.

I found another good tool, very small, named unpack, which is very fast and doesn't create a new directory when extracting the archives. You can install it with

sudo apt install unp

As custom command for extracting archives in Thunar set "unp %f".
It supports many archive file types:

Another command line tool is unar, which also can handle different archive file types (sudo apt install unar), or patool (sudo apt install patool).

For Nautilus in Zorin 17 I found a solution to extract archives fast with the unp tool, but it is not very handy (you have to do more steps than with "extract here").

I created this script at ~/.local/share/nautilus/scripts,


and when I right-click on an archive file and select scripts > rununp, the archive file gets extracted.
You can replace the unp command in the file with other commands you like, e.g. aunpack to use the atool instead.

Is it possible to double-click on an archive file in nautilus of Zorin 17 so that the file is extracted with unp?

I Have had a tangential thought on your topic. Before extracting a tarball it should be inspected for any suspicious code as covered in the Unofficial Manuals for 15, 17 and 18.

I took a look at the handbook of Zorin 17, but to me is not clear how to detect the malware in a list with the content of an archive. I think it takes more experience to know which files belong there and which ones might be malware.

1 Like

So on searching found this for everyday users on best practice (where to extract):

If any part of the tarball contains any filenames with ../ this could indicate a path traversal attack to overwrite system files.

For Servers:

Additionally ClamAV can scan tarballs, but it's most usefulness is for use with a mail server for scanning mail.

We need to remember ClamAV was always meant to be a command line tool. GUIs were added by third parties I think, not part of the ClamAV project.

1 Like

Does anyone have any ideas? In Nautilus (Zorin 17), is the only way to run command-line programs through the Nautilus scripts accessed by right-clicking? Why do custom desktop launchers only work for graphical apps in Nautilus and not for command-line tools like unp or unzip? Do you have to modify the command (unp %f) somehow for it to work? I also have tried to create a custom launcher which runs the nautilus script or to add sh -c to the command, but didn't get it to work.

@Nourpon @Aravisian Is it not possible? I'd like to clarify this question, since what matters to me is whether it's generally possible to apply command-line tools of any kind to files - outside of the terminal. Why does this work in Thunar but not in Nautilus?

1 Like

To be honest I don't know what you want to do, you gave too many informations by doing too many things :wink:
If you want to learn something take a look a this and try to understand what the code do

1 Like

Your personal MIME type associations are stored in ~/.config/mimeapps.list. View the full list:

cat ~/.config/mimeapps.list

This file contains two sections: [Default Applications] which lists your chosen defaults, and optionally [Added Associations] which lists additional application choices per MIME type.

System-wide defaults

cat /usr/share/applications/gnome-mimeapps.list
1 Like