citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

pandocweb-open (284B)


      1 #!/usr/bin/env bash
      2 
      3 url="${2:-$(xclip -o)}"
      4 typ="${1:-pdf}"
      5 
      6 function get_tmpname() {
      7 	hashpart=$(sha256sum <<<"$url" | awk '{print $1}')
      8 	printf "/tmp/out-${hashpart:0:8}.$typ\n"
      9 }
     10 
     11 file="$(get_tmpname)"
     12 (pandocweb "$url" "$file" && open "$file") || notify-send -u critical failed
     13