-
-
Save mlsteele/9f49d3b99680659337ba to your computer and use it in GitHub Desktop.
Download a PDF from a url and view it in zathura.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Launch zathura from a link in your clipboard. | |
# Requires zatweb. | |
set -e | |
URL=$(xclip -selection clipboard -o) | |
zatweb "$URL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Download a PDF from a url and view it in zathura. | |
set -e | |
# trap "cleanup" INT TERM ERR EXIT | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: | |
zatweb <url>" | |
exit 1 | |
fi | |
cleanup() { | |
rm -f "$TMPFILE" | |
} | |
TMPFILE=`mktemp` | |
curl -L "$1" > "$TMPFILE" | |
zathura "$TMPFILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment