Skip to content
/ zaman Public

A simple cli tool that prints (or saves) man pages in a PDF file for an easier reading.

License

Notifications You must be signed in to change notification settings

Antiz96/zaman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zaman

A simple cli tool that prints (or saves) man pages in a PDF file for an easier reading.

Table of contents

Description

A simple tool that prints (or saves) man pages in a PDF file via Zathura for an easier reading.
It also allows you to navigate through all the man pages available on your system via Rofi or Dmenu.

Installation

AUR

Install the zaman AUR package.
Make sure you also have a zathura PDF backend installed (either zathura-pdf-poppler or zathura-pdf-mupdf) as well as a dynamic menu (either rofi or dmenu).

From Source

Install dependencies:

  • Replace zathura-pdf-poppler by zathura-pdf-mupdf if you prefer to use the mupdf backend.
  • Replace rofi by dmenu if you prefer to use that (it's called suckless-tools on Debian/Ubuntu).

Debian/Ubuntu

sudo apt install man-db groff zathura zathura-pdf-poppler rofi

RedHat/Fedora

sudo dnf install man-db groff groff-perl "perl(Compress::Zlib)" zathura zathura-pdf-poppler rofi

Arch Linux

sudo pacman -S man-db groff zathura zathura-pdf-poppler rofi

Gentoo

sudo emerge man-db groff zathura zathura-pdf-poppler rofi

Download the archive of the latest stable release and extract it (alternatively, you can clone this repository via git).

To install zaman, go into the extracted/cloned directory and run the following command:

sudo make install

To uninstall zaman, go into the extracted/cloned directory and run the following command:

sudo make uninstall

Usage

Run the zaman command in your terminal to display a list of all the available man pages on your system (via Rofi or Dmenu), allowing you to search for the one to print as a PDF.

zaman

Alternatively, you can directly specify the man page to open in the command (example below with the "ls" man page):

zaman_cmd

The man page will open as a PDF file in Zathura. Just press q to quit, as you would normally do when reading a man page:

zaman_pdf

You can save a specific man page in a PDF file called "man_command.pdf" in your current directory with the -O (or --save) option (if you run zaman -O without specifying a man page to save, zaman will offer you to select one via rofi/dmenu):

zaman_save

Alternatively, you can specify the destination file with the -o (or --output) option:

zaman_output

Documentation

Directly specify the man page to print as a PDF in the command: zaman 'man page to open'
e.g.: zaman ls

Options:
  -m, --menu                      Print a menu via rofi or dmenu that lists every man pages to choose from (default operation)
  -o, --output <man page> <file>  Save <man page> into the <file> PDF file
  -O, --save <man page>           Save <man page> into the "man_<man page>.pdf" file in the current directory; if <man page> isn't specified, open a menu via rofi or dmenu that lists every man pages to choose from
  -h, --help                      Display this message and exit
  -V, --version                   Display version information and exit

Exit codes:
0  OK
1  Invalid option or man page
2  Neither `rofi` nor `dmenu` are installed
3  User didn't gave the confirmation to proceed
4  User didn't specified a man page or a file to save it to in the -o/--output option

For more information, see the zaman(1) man page

Contributing

You can raise your issues, feedbacks and suggestions in the issues tab.
Pull requests are welcomed as well!