{"id":22959432,"url":"https://github.com/nikitaivanovv/ctpv","last_synced_at":"2025-10-08T11:41:09.758Z","repository":{"id":37205707,"uuid":"494995633","full_name":"NikitaIvanovV/ctpv","owner":"NikitaIvanovV","description":"Image previews for lf file manager","archived":false,"fork":false,"pushed_at":"2024-07-25T04:34:17.000Z","size":2280,"stargazers_count":278,"open_issues_count":48,"forks_count":28,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T01:04:38.875Z","etag":null,"topics":["lf","preview","previewer","ueberzug"],"latest_commit_sha":null,"homepage":"https://www.nikitaivanov.com/man1/ctpv","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NikitaIvanovV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-22T07:58:17.000Z","updated_at":"2025-03-29T04:40:17.000Z","dependencies_parsed_at":"2025-01-18T23:37:56.922Z","dependency_job_id":null,"html_url":"https://github.com/NikitaIvanovV/ctpv","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NikitaIvanovV%2Fctpv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NikitaIvanovV%2Fctpv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NikitaIvanovV%2Fctpv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NikitaIvanovV%2Fctpv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NikitaIvanovV","download_url":"https://codeload.github.com/NikitaIvanovV/ctpv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423513,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lf","preview","previewer","ueberzug"],"created_at":"2024-12-14T18:18:23.622Z","updated_at":"2025-10-08T11:41:04.715Z","avatar_url":"https://github.com/NikitaIvanovV.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ctpv\n\nFile previewer for a terminal\n\n![showcase](doc/showcase.gif)\n\n----\n\nctpv is a file previewer utility for a terminal.\n\nIt was made with integration into [lf file manager][lf] in mind,\nbut I believe that it can be easily integrated into other programs\nas well.\n\nIt supports previews for source code, archives, PDF files, images,\nvideos, etc.\nSee [Previews](#previews) for more info.\n\nImage previews are powered by one of these programs:\n\n* [Überzug][ueberzug] (X11 only)\n* [Chafa][chafa] (X11 and Wayland)\n* [Kitty terminal][kitty]\n\nctpv is a remake of an awesome program named\n[stpv](https://github.com/Naheel-Azawy/stpv).\nstpv did everything I wanted, except it was a bit sluggish because\nit was written in POSIX shell.\nctpv is written in C and is an attempt to make a faster version of\nstpv with a few new features.\n\n## Previews\n\nPreviewing each file type requires specific programs installed on\na system.\nIf a program is not found on the system, ctpv\nwill try to use another one.\nOnly one program is required for each file type.\nFor example, you only need either `elinks`, `lynx` or\n`w3m` installed on your system to view HTML files.\n\n\u003c!-- This table is auto generated! --\u003e\n\u003c!--TABLESTART--\u003e\n| File types | Programs |\n| ---- | ---- |\n| any | [exiftool][exiftool] cat |\n| archive | [atool][atool] |\n| audio | [ffmpegthumbnailer][ffmpegthumbnailer] [ffmpeg][ffmpeg] |\n| diff | [colordiff][colordiff] [delta][delta] [diff-so-fancy][diff-so-fancy] |\n| directory | ls |\n| font | fontimage |\n| gpg-encrypted | [gpg][gpg] |\n| html | [elinks][elinks] [lynx][lynx] [w3m][w3m] |\n| image | [ueberzug][ueberzug] [chafa][chafa] |\n| json | [jq][jq] |\n| markdown | [glow][glow] [mdcat][mdcat] |\n| office | [libreoffice][libreoffice] |\n| pdf | pdftoppm |\n| svg | convert |\n| text | bat cat [highlight][highlight] [source-highlight][source-highlight] |\n| torrent | transmission-show |\n| video | [ffmpegthumbnailer][ffmpegthumbnailer] |\n\n[ffmpegthumbnailer]: https://github.com/dirkvdb/ffmpegthumbnailer\n[w3m]: https://w3m.sourceforge.net/\n[elinks]: http://elinks.cz/\n[fontforge]: https://fontforge.org\n[exiftool]: https://github.com/exiftool/exiftool\n[highlight]: https://gitlab.com/saalen/highlight\n[chafa]: https://github.com/hpjansson/chafa\n[gpg]: https://www.gnupg.org/\n[transmission]: https://transmissionbt.com/\n[delta]: https://github.com/dandavison/delta\n[colordiff]: https://www.colordiff.org/\n[source-highlight]: https://www.gnu.org/software/src-highlite/\n[ueberzug]: https://github.com/seebye/ueberzug\n[mdcat]: https://github.com/swsnr/mdcat\n[glow]: https://github.com/charmbracelet/glow\n[atool]: https://www.nongnu.org/atool/\n[lynx]: https://github.com/jpanther/lynx\n[libreoffice]: https://www.libreoffice.org/\n[diff-so-fancy]: https://github.com/so-fancy/diff-so-fancy\n[imagemagick]: https://imagemagick.org/\n[poppler]: https://poppler.freedesktop.org/\n[jq]: https://github.com/jqlang/jq\n[ffmpeg]: https://ffmpeg.org/\n\n\u003c!--TABLEEND--\u003e\n\n## Installation\n\n### Manual\n\nIf you are building from source, make sure to install these libraries!\nDepending on your system, you probably will also need \"devel\" versions\nof the same libraries.\n\n* `libcrypto`\n* `libmagic`\n\nInstall:\n\n```console\ngit clone https://github.com/NikitaIvanovV/ctpv\ncd ctpv\nmake\nsudo make install\n```\n\nUninstall:\n\n```console\nsudo make uninstall\n```\n\n### AUR\n\nIf you are an Arch Linux user, you can install\n[`ctpv-git`](https://aur.archlinux.org/packages/ctpv-git)\nAUR package.\n\n```console\nyay -S ctpv-git\n```\n\n### MacPorts\n\nWith MacPorts, you can install the\n[`ctpv`](https://ports.macports.org/port/ctpv)\npackage.\n\n```console\nsudo port install ctpv\n```\n\n### Homebrew\n\nWith Homebrew, you can install the\n[`ctpv`](https://formulae.brew.sh/formula/ctpv)\npackage.\n\n```console\nbrew install ctpv\n```\n\n### Nix\n\n#### Nix package\n\n```console\nnix-env -ivf cptv\nnix profile install nixpkgs#cptv # with flakes enabled\n```\n\n#### NixOS and HomeManager\n\nIf you don't need to call it directly and\njust want to use it through lf:\n\n```nix\nprograms.lf = {\n  previewer = {\n    keybinding = \"i\";\n    source = \"${pkgs.ctpv}/bin/ctpv\";\n  };\n  extraConfig = ''\n    \u0026${pkgs.ctpv}/bin/ctpv -s $id\n    cmd on-quit %${pkgs.ctpv}/bin/ctpv -e $id\n    set cleaner ${pkgs.ctpv}/bin/ctpvclear\n  '';\n}\n```\n\n### Gentoo\nAdd this\n[ctpv-9999.ebuild](https://github.com/Sneethe/sneethe-overlay/blob/main/app-misc/ctpv/ctpv-9999.ebuild)\nto your own\n[repository](https://wiki.gentoo.org/wiki/Creating_an_ebuild_repository).\n\nOr alternatively:\n\n```console\neselect repository add sneethe-overlay git https://github.com/Sneethe/sneethe-overlay.git\nemaint sync --repo sneethe-overlay\nemerge --ask --verbose app-misc/ctpv\n```\n\n## Integration\n\n### lf file manager\n\nAdd these lines to your lf config\n(usually located at `~/.config/lf/lfrc`).\n\n```\nset previewer ctpv\nset cleaner ctpvclear\n\u0026ctpv -s $id\n\u0026ctpvquit $id\n```\n\n#### Wayland\n\nIf you use Wayland, follow these steps:\n\n* Make sure you use one of the [terminals that support sixel][sixel]\n* Install [this fork of lf][lf-sixel]\n* Install [Chafa][chafa]\n* Add `set chafasixel` to `~/.config/ctpv/config`\n\nAs of 2023-03-19, original lf does not support sixel protocol,\nwhich is why you need use the fork.\n\n## Documentation\n\nFull documentation on command line options,\nconfiguration and how to define custom previews can be found here:\n\u003chttps://www.nikitaivanov.com/man1/ctpv\u003e\n\n[ueberzug]: https://github.com/seebye/ueberzug\n[kitty]: https://github.com/kovidgoyal/kitty\n[chafa]: https://github.com/hpjansson/chafa\n[lf]: https://github.com/gokcehan/lf\n[lf-sixel]: https://github.com/horriblename/lf\n[sixel]: https://www.arewesixelyet.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikitaivanovv%2Fctpv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikitaivanovv%2Fctpv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikitaivanovv%2Fctpv/lists"}