Skip to content

Instantly share code, notes, and snippets.

@mlsteele
Created March 3, 2016 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlsteele/9f49d3b99680659337ba to your computer and use it in GitHub Desktop.
Save mlsteele/9f49d3b99680659337ba to your computer and use it in GitHub Desktop.
Download a PDF from a url and view it in zathura.
#!/usr/bin/env bash
# Launch zathura from a link in your clipboard.
# Requires zatweb.
set -e
URL=$(xclip -selection clipboard -o)
zatweb "$URL"
#!/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