2022-06-14 13:00:53 +02:00
|
|
|
# ctpv
|
|
|
|
|
|
|
|
Terminal previewer
|
|
|
|
|
|
|
|
![showcase](doc/showcase.gif)
|
|
|
|
|
|
|
|
----
|
|
|
|
|
2022-06-16 07:00:57 +02:00
|
|
|
ctpv is an utility for previewing various files
|
|
|
|
(including images with [Überzug](https://github.com/seebye/ueberzug)).
|
2022-06-14 13:00:53 +02:00
|
|
|
|
2022-06-16 07:00:57 +02:00
|
|
|
ctpv is a remake of an awesome program named
|
|
|
|
[stpv](https://github.com/Naheel-Azawy/stpv) written in C.
|
2022-06-14 13:00:53 +02:00
|
|
|
stpv worked perfectly for me, except it was kinda sluggish because
|
|
|
|
it was written in POSIX shell.
|
2022-06-16 07:00:57 +02:00
|
|
|
ctpv is an attempt to make a faster version of stpv and add some
|
|
|
|
new features.
|
2022-06-14 13:00:53 +02:00
|
|
|
|
|
|
|
Originally it was made for [lf](https://github.com/gokcehan/lf)
|
2022-06-16 07:00:57 +02:00
|
|
|
file manager but I believe that it can be easily integrated into
|
|
|
|
other programs as well if they support previews provided by
|
|
|
|
external programs like lf does.
|
2022-06-14 13:00:53 +02:00
|
|
|
|
2022-06-17 10:41:43 +02:00
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
These programs are needed to make specific previews work.
|
|
|
|
If a preview requires some program and it's not found on the system,
|
|
|
|
`ctpv` will fallback to other previews.
|
|
|
|
|
2022-06-17 10:53:10 +02:00
|
|
|
| File types | Required programs |
|
|
|
|
| ---- | ---- |
|
|
|
|
| Text files | `source-highlight` `highlight` |
|
|
|
|
| Image files | `ueberzug` |
|
|
|
|
| Videos | `ffmpegthumbnailer` |
|
|
|
|
| Diff files | `colordiff` `delta` `diff-so-fancy` |
|
|
|
|
| Markdown | `mdcat` |
|
|
|
|
| JSON files | `jq` |
|
|
|
|
| PDF files | `pdftoppm` |
|
|
|
|
| Torrent files | `transmission-show` |
|
|
|
|
| HTML files | `w3m` `lynx` `elinks` |
|
|
|
|
| Any other files | `exiftool` |
|
2022-06-17 10:41:43 +02:00
|
|
|
|
2022-06-14 13:00:53 +02:00
|
|
|
## Installation
|
|
|
|
|
|
|
|
### Manual
|
|
|
|
|
|
|
|
```sh
|
|
|
|
git clone https://github.com/NikitaIvanovV/ctpv
|
|
|
|
cd ctpv
|
|
|
|
sudo make install
|
|
|
|
```
|
|
|
|
|
|
|
|
Uninstall with `sudo make uninstall`
|
|
|
|
|
|
|
|
## Integration
|
|
|
|
|
|
|
|
### lf file manager
|
|
|
|
|
|
|
|
Add these lines to your lf config
|
|
|
|
(usually located at `~/.config/lf/lfrc`):
|
|
|
|
|
|
|
|
```
|
|
|
|
set previewer ctpv
|
|
|
|
set cleaner ctpvclear
|
|
|
|
&ctpv -s $id
|
|
|
|
cmd on-quit $ctpv -e $id
|
|
|
|
```
|
|
|
|
|
|
|
|
## Documentation
|
|
|
|
|
2022-06-16 07:00:57 +02:00
|
|
|
Full documentation for the program can be found here:
|
|
|
|
https://nikitaivanovv.github.io/ctpv/
|