Skip to content

monoamine11231/MeowPDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MeowPDF Logo

MeowPDF

A Kitty terminal PDF viewer with Vim-like keybindings and classical GUI-like usage.

Latest release GitHub commits Stars Fork Watchers


Note that the colours in the overview above are corrupted because of GIF compression.


Why?

There are multiple in-terminal PDF viewers for the Kitty terminal but the main problem is that the end-user can interact only by viewing one page at a time. The user may have the need to zoom in and out of the PDF document to view details in the document. Another problem is viewing continuous content which is split between multiple pages. Therefore it was decided to develop such PDF viewer which can operates in the same way as a classical GUI PDF viewer but which can additionally be controlled by powerful Vim-like keybindings.

Warning

This project is currently under it's early development state; there can be many bugs and problems. The codebase is weak and going to be upgraded in the near future to minimize dependencies and possible bugs.


Table of Contents


Requirements

  • Cargo
  • Rust
  • Kitty >= 0.20.0

Note

A Kitty terminal version larger than 0.20.0 is necessary for the viewer to work because of the cursor control feature in the protocol (#3411).


Installation

The project is easily built using Cargo:

$ cargo build

...and as easily installed:

$ cargo install --path .

Usage

To view a PDF file simply execute:

$ meowpdf <PATH TO PDF FILE>

Keybindings

There are a set of keybindings implemented in this viewer which are listed below:

  • q: Quit
  • a: Toggles alpha on PDF pages (Makes white background of PDF pages transparent)
  • i: Toggles color inversion on PDF pages
  • <S>+g: Jumps to the last page of the PDF document
  • <left>: Move the document to the left
  • <right>: Move the document to the right
  • <up>: Move the pages up (& the document down)
  • <down>: Move the pages down (& the document up)
  • +: Zoom in
  • -: Zoom out

Configuration

One of the key-features of MeowPDF is it's high customizability. MeowPDF allows customization based on the following parameters:

  • Scroll speed
  • Static render precision for PDF pages
  • Memory limit on rendered PDF pages
  • Default document scale on enter (will be replaced by a dynamic one soon)
  • Minimal allowed zoom out amount on the document
  • Zoom amount
  • Margin amount on the bottom of PDF pages
  • Preloaded pages before and after the first displayed page

The configuration YAML file is found in ~/.config/meowpdf.


TODO

Future ideas

  • Remove heavy and inefficient regex dependency and move to nested switches.
  • Implement or find a standard on parsing stdin key inputs.
  • Allow for link clicking using the mouse.
  • Allow custom remapping of keybindings.

In progress

  • Implement auto-scaling of the PDF document on opening based on terminal size.
  • Develop a customizable Vim-like bar illustrating page & document metrics.

Contributions

All contributions are welcome to this project.


License

MeowPDF is available under MIT.


Attributions

  1. Logo was made using Peeking Cat Vectors by Vecteezy.
  2. README design was inspired from areg-sdk.