To set Zathura as the default PDF viewer on your system (Linux), you can follow these steps depending on your desktop environment and distribution.
✅ Step 1: Install Zathura (if not already installed)
For Debian/Ubuntu-based systems:
bash
sudo apt install zathura
For Arch Linux:
bash
sudo pacman -S zathura
For Fedora:
bash
sudo dnf install zathura
🛠️ Step 2: Set Zathura as Default PDF Viewer
There are several ways to do this, depending on your desktop environment or setup.
🔧 Option A: Using xdg-mime (Command Line Method)
This works across most desktop environments.
1. Check current default application for PDFs:
bash
xdg-mime query default application/pdf
It might return something like evince.desktop, okular.desktop, etc.
2. Find the correct .desktop file for Zathura
Run:
bash
ls /usr/share/applications | grep zathura
You’ll likely see something like org.pwmt.zathura.desktop.
3. Set Zathura as the default PDF handler:
bash
xdg-mime default org.pwmt.zathura.desktop application/pdf
Replace org.pwmt.zathura.desktop with whatever command from step 2 returns.
🖥️ Option B: GUI Method (GNOME, KDE, XFCE, etc.)
For GNOME or Ubuntu:
- Open Settings
- Go to Details > Default Applications
- Under "Documents", select Zathura from the dropdown.
For KDE Plasma:
- Open System Settings
- Go to Default Applications
- Select Document Viewer, choose Zathura, and click Apply.
For XFCE:
- Open Settings Manager
- Go to Preferred Applications
- Under the Utilities tab, change the PDF Reader to Zathura.
📁 Optional: Set for other MIME types
PDFs use the MIME type application/pdf, but sometimes other related types are used:
bash
xdg-mime default org.pwmt.zathura.desktop application/x-pdf
Also ensure that file associations in your file manager (like Thunar, Nemo, Dolphin) are updated.
✅ Verify It's Working
Try opening a PDF file from your file manager or via:
bash
xdg-open document.pdf
It should open in Zathura now.
Let me know if you're using a specific desktop environment (e.g., i3, sway, KDE, GNOME, XFCE), and I can tailor the instructions further!