Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Geeqie: add atril as action

The story

I have tried using geeqie as an alternative to Irfanview. It doesn't do everything Irfanview does, but I can at least use mostly native software most of the time.

So, I recently learned that geeqie does have the ability to navigate through paged documents (read: pdf files). But there's no default hotkeys (at least in Devuan GNU+Linux) for these functions, so the user must click through the menu. Instead of hijacking page up/down from their default values (next/previous file, which are also mapped to up/down arrow keys), I decided to make life difficult for myself.

I had seen the menu entries for plugins. And I noticed that my own custom package of Irfanview which follows the XDG standard for desktop menu entries is properly listed. So I read up on how to add an action, so I can open a file in atril, which is a fork of evince back when it was good (read: from the MATE team).

The solution involves placing file /usr/share/geeqie/applications/atril.desktop:

[Desktop Entry]
Type=Application
Version=1.0
Name=Atril Document Viewer
GenericName=Document Viewer
Comment=View multi-page documents
Exec=atril %U
Type=Application
Icon=atril
Categories=Graphics;Viewer;X-Geeqie;
Keywords=MATE;document;viewer;pdf;dvi;ps;xps;tiff;pixbuf;djvu;comics;
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;application/x-xzpdf;application/postscript;application/x-bzpostscript;application/x-gzpostscript;image/x-eps;image/x-bzeps;image/x-gzeps;application/x-dvi;application/x-bzdvi;application/x-gzdvi;image/vnd.djvu;image/vnd.djvu+multipage;image/tiff;application/x-cbr;application/x-cbz;application/x-cb7;application/x-cbt;application/vnd.comicbook+zip;application/vnd-comicbook.rar;image/*;application/oxps;application/vnd.ms-xpsdocument;application/epub+zip;

Which I derived by removing the localization (sorry, i18n users) entries from the real .desktop file with a grep statement and also adding the important keywords Graphics, Viewer, and X-Geeqie for good measure.

I think it should have interpreted entries in ~/.local/share/geeqie/applications but I didn't test that.

I'll think I'll add this file to my deployment scripts.

Comments