Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Following links in zathura #30

Open
Eloitor opened this issue Oct 26, 2023 · 0 comments
Open

Following links in zathura #30

Eloitor opened this issue Oct 26, 2023 · 0 comments

Comments

@Eloitor
Copy link

Eloitor commented Oct 26, 2023

Hi, I was trying to follow links between files in zathura.

Using zathura-pdf-poppler, zathura outputs an error if it can't find the file. I used this error to redirect zathura to the correct path (assuming the file is read from the cache).

~/.local/bin/linkzathu.sh

#! /bin/sh

zathura "$1" 2> /dev/stdout  | awk -vd=$(pwd) -vc="$HOME/.cache/zaread" -F"«|»" 'NF > 0 && !/^error/ { gsub(c, d, $2); print $2 ; system("") }' | xargs -r -n 1 zaread

Setting READER="linkzathu.sh" in zareadrc, links on pdf files are opened in zathura (converted using zaread if necessary).

Example use:
A.md: has link to B.md
zaread A.md and following the B.md link, opens B.md in zaread

I don't know if you are interested in this, or if this small script fits this project at all. Feel free to add it in a section of the README or in a scripts folder, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants