Kleopatra allows the administrator (and power-user) to configure the list of archivers that are presented in the Sign/Encrypt Files dialog.
Each archiver is defined in
libkleopatrarc as a separate
Archive Definition #
group, with the following mandatory keys:
A comma-separated list of filename extensions that usually indicate this archive format.
A unique ID used to identify this archiver internally. If in doubt, use the name of the command.
The user-visible name of this archiver, as shown in the corresponding drop-down menu of the Sign/Encrypt Files dialog.
The actual command to archive files. You can use any command, as long as no shell is required to execute it. The program file is looked up using the
PATHenvironment variable, unless you use an absolute file path. Quoting is supported as if a shell was used:
pack-command="/opt/ZIP v2.32/bin/zip" -r -
Since backslash (
\) is an escape
character in KDE config files, you need to double them when
they appear in path names:
However, for the command itself (as opposed to its
arguments), you may just use forward slashes
/) as path separators on all platforms:
This is not supported in arguments, as most Windows® programs
use the forward slash for options. For example, the
following will not work, since
C:/myarchivescript.bat is an argument to
/ is not
\ in arguments, only
This needs, instead, to be written as:
There are three ways to pass filenames to the pack
command. For each of these,
pack-command provides a particular syntax:
As command-line arguments.
pack-command=tar cf -
pack-command=zip -r - %f
In this case, filenames are passed on the command line, just like you would when using the command prompt. Kleopatra does not use a shell to execute the command. Therefore, this is a safe way of passing filenames, but it might run into command line length restrictions on some platforms. A literal
%f, if present, is replaced by the names of the files to archive. Otherwise, filenames are appended to the command line. Thus, the zip Example above could equivalently be written like this:
pack-command=zip -r -
Via standard-in, separated by newlines: prepend
pack-command=|gtar cf - -T-
pack-command=|zip -@ -
In this case, filenames are passed to the archiver on stdin, one per line. This avoids problems on platforms which place a low limit on the number of command line arguments that are allowed, but fails when filenames, in fact, contain newlines.
Kleopatra currently only supports LF as a newline separator, not CRLF. This might change in future versions, based on user feedback.
Via standard-in, separated by NUL-bytes: prepend
pack-command=0|gtar cf - -T- --null
This is the same as above, except that NUL bytes are used to separate filenames. Since NUL bytes are forbidden in filenames, this is the most robust way of passing filenames, but not all archivers support it.