Image previews for lf file manager
Go to file
2022-06-20 22:17:25 +05:00
doc Fix: magic(5) -> libmagic(3) 2022-06-20 22:17:25 +05:00
embed Minor 2022-05-24 01:03:13 +05:00
prev Fix broken source-highlight 2022-06-20 13:58:37 +05:00
sh Add kitty terminal support 2022-06-19 18:03:39 +05:00
src Fix: these are gnu-specific 2022-06-20 15:00:27 +05:00
.gitignore Initial commit 2022-05-22 12:56:26 +05:00
ctpvclear ctpvclear: add option to pass id as argument 2022-05-29 21:40:11 +05:00
deplist.1.sh Autogenerate dependency table 2022-06-18 20:50:57 +05:00
deplist.awk Minor 2022-06-18 22:25:53 +05:00
deplist.md.sh Autogenerate dependency table 2022-06-18 20:50:57 +05:00
deplistadd.sh Autogenerate dependency table 2022-06-18 20:50:57 +05:00
LICENSE Initial commit 2022-05-22 12:56:26 +05:00
Makefile Move scripts to sh/ 2022-06-18 22:29:56 +05:00
previews.h Add support for symlinks 2022-06-19 20:08:07 +05:00
README.md Minor 2022-06-19 20:23:16 +05:00

ctpv

Terminal previewer

showcase


ctpv is an utility for previewing various files (including images with Überzug).

ctpv is a remake of an awesome program named stpv written in C. stpv worked perfectly for me, except it was kinda sluggish because it was written in POSIX shell. ctpv is an attempt to make a faster version of stpv and add some new features.

Originally it was made for lf 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.

Dependencies

Previewing each file type requires specific programs. If a program is not found on the system, ctpv will try to use another one. Only one program is required for each file type. For example, you only need either elinks, lynx or w3m installed on your system to view HTML files.

File types Programs
any exiftool cat
archive atool
diff colordiff delta diff-so-fancy
directory ls
html elinks lynx w3m
image ueberzug
json jq
markdown mdcat
odt libreoffice
pdf pdftoppm
text bat cat highlight source-highlight
torrent transmission-show
video ffmpegthumbnailer

Installation

Manual

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

Full documentation for the program can be found here: https://nikitaivanovv.github.io/ctpv/