#!/bin/sh
#
# vi:set et ai sw=2 sts=2 ts=2:
# -
# file-roller.tap - Wrapper script to create and extract archive files
# in Thunar, via the thunar-archive-plugin, using the
# file-roller archive manager.
#
# Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>
# Copyright (c) 2011 Jannis Pohlmann <jannis@xfce.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
# determine the action and the folder, $@ then contains only the files
action=$1; shift;
folder=$1; shift;
# check the action
case $action in
create)
exec file-roller "--default-dir=$folder" --add "$@"
;;
extract-here)
exec file-roller "--extract-to=$(pwd)" --extract-here --force "$@"
;;
extract-to)
exec file-roller "--default-dir=$folder" --extract "$@"
;;
*)
echo "Unsupported action '$action'" >&2
exit 1
esac

#!/bin/sh
#
# template.tap - Template for a wrapper script to create and extract
# archive files in Thunar, via the thunar-archive-plugin.
# Use this file as a base to create .tap files for other
# archive managers.
#
# $Id$
#
# Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA.
#
# determine the action and the folder, "$@" (don't forget the
# double-quotes, otherwise files with spaces will not be handled
# properly) then contains only the files
action=$1; shift;
folder=$1; shift;
# check the action
case $action in
create)
# Invoke the archive manager with parameters to create
# a new archive with the files in "$@". The $folder
# should be used as a suggestion for the user where
# to put the new archive to.
;;
extract-here)
# Invoke the archive manager with parameters to extract
# the archive files in "$@" to the $folder. The archive
# manager should start extraction immediately and do not
# popup up any confirmation or file chooser dialogs.
;;
extract-to)
# Invoke the archive manager with parameters to extract
# the archive files in "$@". The archive manager should
# prompt the user with a folder chooser dialog, where
# $folder can be used as a suggestion.
;;
*)
echo "Unsupported action '$action'" >&2
exit 1
esac

thunar-archive-plugin currently supports file-roller (the GNOME archive manager)and ark (the KDE archive manager), but support for additional archive managerscan be easily added.

To add support for a new archive manager, all you need to do is to installthe .desktop file - with the list of supported mime types - for the archivemanager to the $(datadir)/applications/ folder (as usual), and in addition,install a .tap file to $(libexecdir)/thunar-archive-plugin/, which providesa wrapper script that invokes the archive manager with the appropriateparameters for the actions "Create Archive", "Extract Here" and "Extract To".

The .tap and .desktop files should have the same basename, otherwise thethunar-archive-plugin is not able to find the appropriate .tap file for anarchive manager. For example, if the name of the .desktop file is ark.desktop,the .tap file must be named ark.tap.

See the scripts/ directory for examples of how to create said .tap files. Thetemplate.tap file should provide a good starting point.

Note that the thunar-archive-plugin takes the applications from the desktopdatabase, so after installing new archive managers in $prefix (i.e. /usr or/usr/local), make sure to run

update-desktop-database $prefix/share/applications

Most modern packagement systems will do this for you automatically, but ifyou are installing archive managers manually, you may need to run the abovecommand first, otherwise you will get an error message telling you that nosupport archive managers were found on your system.

The full list of strings accepted as quick link to PeaZip functions when passed as first parameter is:-add2archive: add to a new archive and open PeaZip GUI to set archive’s type and options;-add2archive-add as -add2archive, but add to existing archive (if found)-add2archive-update as previous, but update older files only-add2pea: add to a new .pea archive;-add2crypt: add to a new encrypted .pea archive;-add2split: raw split a single input file;-add2wipe: securely delete selected file(s);-add2compare: byte to byte compare two files;-add27z: add to a new .7z archive;-add27zmail: add to a new .7z archive and attach it to a mail (requires compatible mail client) *38-add2separate7z: add each input to a separate new .7z archive;-add2sfx7z: add to a new self extracting 7z archive (.exe);-add2sfx7zmail: add to a new self extracting archive and attach it to a mail (requires compatible mail client) *-add2zip: add to a new .zip archive;-add2zipmail: add to a new .zip archive and attach it to a mail (requires compatible mail client) *-add2separatezip: add each input to a separate new .zip archive;-ext2browse: open (and browse if applicable) the archive(s) in PeaZip GUI;-ext2browsepath: browse the selected folder (or its path, if a file is selected) in PeaZip-ext2here: extract archive(s) here;-ext2folder: extract archive(s) here, each in a new folder named after the archive;-ext2full: extract archive(s), allowing to specify i/o options, password and keyfile;-ext2to: extract archive(s) to specified folder;-ext2tofolder: extract archive(s) to specified folder, each in a new folder named after the archive;-ext2list: list archive(s) content, to quickly look what is in the archive;-ext2test: test archive(s) content;-ext2main: extract archives from main applications “Archive extraction” interface;-ext2commandprompt: open the command prompt in the selected folder (or in its path, if a file is selected)-ext2openpwtest requires password as paramstr(2) (always delimited) and archive’s full name as paramstr(3): tryto list the archive and terminate with exit code 0 if archive is not encrypted, 1 if it is encrypted, 2 if it is nonreadable (corrupted or with encrypted file list), -1 if archive is not found.-peazipreset: reset PeaZip configuration, as Options > Reset button; can resolve unexpected problems withconfiguration, restarting the application with factory settings