/fancy-cat

PDF reader for terminal emulators using the Kitty image protocol

Primary LanguageZigMIT LicenseMIT

📑
fancy-cat

PDF viewer for terminals using the Kitty image protocol

demo

Usage

fancy-cat <path-to-pdf> <optional-page-number>

Keymappings and other options can be found and changed in src/config.zig.

Installation

Arch Linux

fancy-cat is available as a package in the AUR. You can install it using an AUR helper (e.g., paru):

paru -S fancy-cat

Build Instructions

Requirements

  • Zig version 0.13.0
  • Terminal emulator with the Kitty image protocol (e.g. Kitty, Ghostty, WezTerm, etc.)
  • MuPDF

MacOS

brew install mupdf

Linux

apt install \
    libmupdf-dev \
    libharfbuzz-dev \
    libfreetype6-dev \
    libjbig2dec0-dev \
    libjpeg-dev \
    libopenjp2-7-dev \
    libgumbo-dev \
    libmujs-dev \
    zlib1g-dev

Important

On some Linux distributions (e.g., Fedora, Arch), replace mupdf-third with mupdf in build.zig to compile successfully.

Build

  1. Fetch dependencies:
zig build --fetch
  1. Build the project:
zig build --release=fast
  1. Install:
# Add to your PATH
# Linux
mv zig-out/bin/fancy-cat ~/.local/bin/

# macOS 
mv zig-out/bin/fancy-cat /usr/local/bin/

Run

zig build run -- <path-to-pdf> <optional-page-number>

Features

  • ✅ Filewatch (hot-reload)
  • ✅ Custom keymapping
  • ✅ Dark-mode
  • ✅ Zoom
  • ✅ Status bar
  • 🚧 Cache
  • 🚧 Search

Contributing

Contributions are welcome.