minimize | streamline | use clean format

This commit is contained in:
Emre AKYÜZ 2024-01-05 12:36:34 +03:00 committed by GitHub
parent 7a96fb100c
commit 859d8e3288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,10 +4,18 @@
# usually the pdf of a compiled document. I find this useful especially # usually the pdf of a compiled document. I find this useful especially
# running from vim. # running from vim.
basename="${1%.*}" silent_open() {
setsid -f "${@}" > /dev/null 2>&1
}
case "${*}" in case "${1}" in
*.tex|*.sil|*.m[dse]|*.[rR]md|*.mom|*.[0-9]) target="$(getcomproot "$1" || echo "$1")" ; setsid -f xdg-open "${target%.*}".pdf >/dev/null 2>&1 ;; *.tex | *.sil | *.m[dse] | *.[rR]md | *.mom | *.[0-9])
*.html) setsid -f "$BROWSER" "$basename".html >/dev/null 2>&1 ;; silent_open xdg-open "$(getcomproot "${1}" || echo "${1%.*}").pdf"
*.sent) setsid -f sent "$1" >/dev/null 2>&1 ;; ;;
*.html)
silent_open "${BROWSER}" "${1%.*}.html"
;;
*.sent)
silent_open sent "${1}"
;;
esac esac