This commit is contained in:
Nikita Ivanov 2022-06-14 17:19:18 +05:00
parent 52667953af
commit 5ee4d34d81
No known key found for this signature in database
GPG Key ID: 6E656AC5B97B5133

View File

@ -77,10 +77,19 @@ ctpv \- terminal previewer
. .
.B ctpv .B ctpv
is a previewer utility made for integration into other programs. is a previewer utility made for integration into other programs.
It supports a variety of \(lqpreviews\(rq out of the box It supports a variety of \(lqpreviews\(rq out of the box,
(including one for previewing images with as well as an option to define custom ones.
.IR ueberzug ) .PP
and an option for defining custom previews. .
When
.B ctpv
is given
.I file
(and, optionally, other arguments (see
.IR SYNOPSIS )),
it determines an appropriate preview for it and runs its script.
The script produces preview content and prints it to
.IR stdout .
. .
.SS Integration .SS Integration
. .
@ -102,7 +111,7 @@ Initially,
.B ctpv .B ctpv
retrieves MIME type and extension from retrieves MIME type and extension from
.I file .I file
given in the first argument (MIME type is extracted using passed in the first argument (MIME type is extracted using
.BR magic (5)). .BR magic (5)).
.PP .PP
. .
@ -121,7 +130,7 @@ goes through the list starting with the first element
and checks if a preview matches and checks if a preview matches
.IR file \(aqs .IR file \(aqs
extension and MIME type. extension and MIME type.
If it does, it runs the preview script. If it does, it runs a preview script.
If the script exits with status 127 If the script exits with status 127
(which usually means that a command was not found), (which usually means that a command was not found),
the next appropriate preview is selected, and so on. the next appropriate preview is selected, and so on.
@ -160,9 +169,9 @@ Kill server with ID
. .
The configuration file format somewhat resembles one used by The configuration file format somewhat resembles one used by
.IR lf . .IR lf .
There are several commands that allow you to customize There are several commands that
.B ctpv behavior of
behavior. .BR ctpv .
Commands are separated by newlines. Commands are separated by newlines.
Comments start with number sign Comments start with number sign
.RB ( # ) .RB ( # )
@ -262,7 +271,7 @@ preview any_text_example text/* {{
. .
Setting subtype to Setting subtype to
.B * .B *
will make the preview work for any file which MIME type starts with will make the preview above work for any file which MIME type starts with
.BR text/ . .BR text/ .
. .
.SS Setting priority .SS Setting priority