This tutorial will guide you through installing, configuring, and using Zathura with the MuPDF backend on Arch Linux, specifically tailored for an i3wm environment. It covers installation, configuration, printing, and a comprehensive overview of the most important shortcuts.


1. Introduction

Zathura is a lightweight yet powerful PDF viewer that features a minimalist user interface, making it an excellent fit for lightweight window managers like i3wm. By using plugin backends like MuPDF or Poppler, you can maintain a minimal setup without sacrificing essential features such as search, bookmarks, or printing.

Advantages of Zathura:

  • Very few dependencies (only Girara/GTK, and a backend like MuPDF or Poppler)
  • Keyboard-centric control (ideal for i3wm)
  • Extensible via plugins (e.g., for Synctex or annotations)
  • Highly configurable through a simple text file

2. Installation

  1. Install Zathura & the MuPDF Backend Open a terminal and execute the following command:

    sudo pacman -S zathura zathura-pdf-mupdf
    
  2. Launch Zathura After installation, you can open a PDF file like this:

    zathura document.pdf
    

3. Setting Zathura as the Default PDF Viewer

If you were previously using a different viewer like Evince (e.g., in mimeapps.list), your configuration might look like this:

application/pdf=org.gnome.Evince.desktop

To make Zathura the new default for PDF files, you need to add or edit the following line in your ~/.config/mimeapps.list (or ~/.local/share/applications/mimeapps.list):

[Default Applications]
application/pdf=org.pwmt.zathura.desktop

This sets Zathura as the default application for the application/pdf MIME type.


4. Configuring Zathura

Zathura reads its configuration from ~/.config/zathura/zathurarc. Here is an example of a minimal configuration:

# ~/.config/zathura/zathurarc

# 1. Set the default backend to MuPDF
set pdf-mupdf true

# 2. Adjust page to fit width on open
set adjust-open "fit-width"

# 3. Set default zoom level (100%)
set zoom 1.0

# 4. Remap keys (optional)
map <C-f> search-forward
map <C-b> search-backward

# 5. Set bookmark file path
set bookmark-path "~/.config/zathura/bookmarks"

Explanation of Key Options

  • set pdf-mupdf true: Specifies that Zathura should use the MuPDF backend instead of Poppler.
  • set adjust-open "fit-width": Automatically fits the page to the windowโ€™s width when opening a document.
  • set zoom 1.0: Sets the default zoom level to 100%.
  • map <C-f> search-forward: Remaps Ctrl+f for searching forward.
  • map <C-b> search-backward: Remaps Ctrl+b for searching backward.
  • set bookmark-path "...": Defines the directory where bookmark files are stored.

5. Printing Functionality

Zathura supports printing directly via GTK. To print a PDF:

  1. Open the PDF in Zathura:
    zathura document.pdf
    
  2. In the viewer, simply press P or enter the command:
    :print
    
  3. The standard GTK print dialog will open, allowing you to select a printer, page range, scaling, and other options.

Internally, GTK generates a temporary PDF (using Cairo) and sends it to CUPS, so no additional plugins are usually necessary.

Tip: If you prefer to print directly from the shell, you can always use:

lp document.pdf

This works independently of your chosen PDF viewer.


6. Overview of Essential Keyboard Shortcuts

Zathura is heavily designed for keyboard control. Below are the most useful shortcuts organized by category.

6.1 Navigation

ActionCommand
Next Pagej or โ†“
Previous Pagek or โ†‘
First Pagegg
Last PageG
Go to Specific Page:page <number> (e.g., :page 10)

6.2 Zoom & View

ActionCommand
Zoom Inzi or +
Zoom Outzo or -
Original Sizezr
Fit to Widthzb
Fit to Heightzh
Toggle Fullscreenf

6.3 Search & Bookmarks

ActionCommand
Search Forward/ followed by search term
Search Backward? followed by search term
Next Search Resultn
Previous Search ResultN
Add Bookmarkm (then choose a letter)
Open Bookmark List:bookmarks
Jump to Bookmark` followed by the letter

6.4 Document Operations

ActionCommand
PrintP or :print
Reload DocumentR
Open Console (Command line in viewer):

6.5 General Commands

ActionCommand
Show HelpH
Reload Configuration:config-reload
Quitq

Note: Many of these commands can be remapped in ~/.config/zathura/zathurarc. See Section 4 for examples.


7. Summary

  • Installation:
    sudo pacman -S zathura zathura-pdf-mupdf
    ```-   **Set as Default PDF Viewer:**
    In `~/.config/mimeapps.list`:
    ```ini
    [Default Applications]
    application/pdf=org.pwmt.zathura.desktop
    
  • Configuration: Via ~/.config/zathura/zathurarc (see example file).
  • Usage: Keyboard-centric, with quick access to search, zoom, bookmarks, and printing (P / :print).
  • Printing: Opens the GTK print dialog, using CUPS via Cairo.

Zathura is ideal for users who want a lean, fast-starting PDF viewer with essential features, without the heavy dependencies of large desktop environments like GNOME or KDE.

Enjoy reading with Zathura on i3wm