Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-12-16 12:23:37

zakazak
Member
Registered: 2018-12-11
Posts: 13

Thunar - Change "Extract here" to work with p7zip-gui?

Hello everyone, 
comming from Windows and 7-zip it seems like p7zip-gui is the only real option I can choose.
Also its performance/features/settings are better than the other archive managers (xarchiver, file-roller, engrampa,...).

How ever, I can't get the standard "extra here" / "extract to" / "create archive" shortcuts in thunar to work with p7zip-gui.

Is there any way to edit or remove those entries? Custom actions work ofcourse smile

OS: Arch

Thanks in advance!

Offline

#2 2018-12-16 16:24:11

zakazak
Member
Registered: 2018-12-11
Posts: 13

Re: Thunar - Change "Extract here" to work with p7zip-gui?

Okay nvm, I removed the thunar-archive-plugin which also removes the entries from the context menu.
Then I created my own custom actions to work with p7zip-gui smile

So far XFCE rocks.. everything can be configured... everything!

Offline

#3 2018-12-16 19:46:59

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 5,112

Re: Thunar - Change "Extract here" to work with p7zip-gui?

If you still want the archive plugin to work, I've figured it out. The biggest challenge was the p7zip-gui file p7zipForFilemanager - there is a bug in the way it processes incoming data. This was a bugger to figure (I've got unzipped files scattered throughout). I've accounted for it in the tap file.

To begin with, have a read through the thunar-archive readme file for a general understanding of how it works.

Then create a /usr/lib/xfce4/thunar-archive-plugin/7zFM.tap file (it has to be called the same name as the desktop file in /usr/share/applications) with the following content:

#!/bin/sh
#
# vi:set et ai sw=2 sts=2 ts=2:
#
action=$1; shift;
folder=$1; shift;

# check the action
case $action in
create)
	exec p7zipForFilemanager ad "$folder" "$@"
	;;

extract-here)
	exec p7zipForFilemanager x "$folder/_zz" "$@"
	;;

extract-to)
	exec p7zipForFilemanager xd "$folder/_zz" "$@"
	;;

*)
	echo "Unsupported action '$action'" >&2
	exit 1
esac

A couple of other "things-to-maybe-do":

  1. Run (as root):

    update-desktop-database /usr/share/applications
  2. If you have another archive manager(s) installed - look at the supported list in /usr/lib/xfce4/thunar-archive-plugin - it may take precedence. I don't know of a way to specify in the plugin which archive manager to use. You'll need to rename/delete the associated tap file so that it isn't used. For example, I have engrampa installed so I had to rename engrampa.tap to engrampa.tap.BAK so it would use the 7zFM.tap file

Hope this helps.

Offline

#4 2018-12-16 21:24:11

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 5,112

Re: Thunar - Change "Extract here" to work with p7zip-gui?

ToZ wrote:

If you have another archive manager(s) installed - look at the supported list in /usr/lib/xfce4/thunar-archive-plugin - it may take precedence. I don't know of a way to specify in the plugin which archive manager to use. You'll need to rename/delete the associated tap file so that it isn't used. For example, I have engrampa installed so I had to rename engrampa.tap to engrampa.tap.BAK so it would use the 7zFM.tap file

It looks like it selects the default archive manager (or asks) if there are multiple available ones in the /usr/lib/xfce4/thunar-archive-plugin folder. So no need to rename the other files, just make p7zip your default archiver.

Offline

#5 2019-01-22 06:23:49

sh4tr
Member
Registered: 2014-03-20
Posts: 26

Re: Thunar - Change "Extract here" to work with p7zip-gui?

you could just click to extract, you only need p7zip

~/.local/bin/extract.sh
#!/usr/bin/dash
mkdir "${1%%.*}"
chdir "${1%%.*}"
7z x "$1"
~/.local/share/applications/extract.desktop
[Desktop Entry]
Type=Application
Name=EXTRACT
Exec=extract.sh %f
StartupNotify=false
#Terminal=true
NoDisplay=true
Icon=archive-extract

Offline

Board footer

Powered by FluxBB