It is also a nautilus script. My script works when I go to nautilus scripts in the right-click menu and select it, this is not the question.
The script or another custom command shall be executed by double-clicking on the file.
My goal is:
Instead of running a command as e.g. unp file or unzip file
in the terminal or by selecting my nautilus script, I want to double-click the file in Nautilus to execute the command automatically. I'm referring to Zorin 17.
I just noticed (running Zorin 18 at the moment) that the terminal tools extract the archive not to Downloads, but to ~ when they are set as default applications by a custom launcher. Until now, I've always just observed the Downloads folder to see if it appears there. So they seem to work in Zorin 18 but I haven't figured out how to set another path for the extraction.
I'll test it on Zorin 17, too.
Edit: It is the same on Zorin 17. The command line tools work, but extract the files to ~.
Finally, I found a way to extract the archives to the Downloads folder by setting this command in the custom launcher (you can adapt it to other tools like unzip,...)
sh -c "cd ~/Downloads; unp %f"
Now, by double-clicking on an archive file in Nautilus, it gets extracted with the unp tool into Downloads folder. Problem solvedš.
How can you be certain that doing this without checking the contents that you accidentally start a process that could potentially overwrite system files?
I can't do that, and I've never checked archives in my life before extracting them, because I'm a regular user, not an expert, and I'm not familar with that.
I'm tobut this thread wasn't about that question. Maybe it would be a good idea to start a separate thread on the topic. I just noticed that in Zorin 18 Core, extracting archives in Nautilus is so much faster and easier than in the other versions. I wanted to replicate it to get a similar function, especially for Thunar in Zorin Lite.
I've always found it annoying when windows pop up and you have to confirm the extraction again, especially when the buttons you need to click are on the opposite side of the window, and afterwards you have to close that pop-up window to disappear (it took a while until I found out that "extract here" in the context menu is faster and bypasses the pop-up windows).
If itās so insecure, why was the feature to unpack archives immediately introduced in the first place? I havenāt seen any threads over the past year that have addressed this issue or given warnings and helps for the users. I think the vast majority of users just double-click.
I'm wondering if it is better then to install themes and software only from the preinstalled repositories and not from github, gnome/xfce look or others. Because usually all themes are archive files.
Well it only takes one bad actor to create a maelstrom, look at what happened with .xz?
I am no expert myself, that is why I copied Blackwolf's instructions from Ultimate Edition Oz forum. He was a senior moderator. If anything is not from an official repo it should really be inspected prior to installation especially if any item begins with ../ which can overwrite system files.
I was a little relieved when I saw today that the German Arch Wiki for Thunar also suggests my command unp %f as a custom action. I was really worried that what I'd done here was a total mess (though I personally think it's a significant improvement compared to file-roller, and the unp package is just 15kb).