opout (490B) - raw


      1 #!/bin/sh
      2 # opout: "open output": A general handler for opening a file's intended output.
      3 # I find this useful especially running from vim.
      4 
      5 basename="$(echo "$1" | sed 's/\.[^\/.]*$//')"
      6 
      7 case "$1" in
      8 	*.tex|*.rnw|*.gd|*.md|*.rmd|*.ms|*.me|*.mom) setsid "$READER" "$basename".pdf >/dev/null 2>&1 & ;;
      9 	*.html) setsid "$BROWSER" --new-window "$basename".html >/dev/null 2>&1 & ;;
     10 	*.sent) setsid sent "$1" >/dev/null 2>&1 & ;;
     11 esac && sleep 0.1 && dwmc rotatestack -1 && dwmc focusmaster &