dotfiles

personal configuration files and scripts
git clone https://tongong.net/git/dotfiles.git
Log | Files | Refs | README

opout (424B)


      1 #!/bin/sh
      2 
      3 # opout: "open output": A general handler for opening a file's intended output,
      4 # usually the pdf of a compiled document.  I find this useful especially
      5 # running from vim.
      6 
      7 basename="$(echo "${*}" | sed 's/\.[^\/.]*$//')"
      8 
      9 case "${*}" in
     10 	*.tex|*.m[dse]|*.[rR]md|*.mom|*.[0-9]) setsid -f xdg-open "$basename".pdf >/dev/null 2>&1 ;;
     11 	*.html|*.remark) setsid -f "$BROWSER" "$basename".html >/dev/null 2>&1 ;;
     12 esac