summaryrefslogtreecommitdiff
path: root/.local/bin/development/opout
diff options
context:
space:
mode:
authorVikas Kushwaha <dev@vikas.rocks>2024-11-21 13:30:52 +0530
committerVikas Kushwaha <dev@vikas.rocks>2024-11-21 13:30:52 +0530
commit5c916d69d457101326803eb076a746060e3618cf (patch)
treed6fce3256eede1c1bf78fb6a1be75b9cc4b84cee /.local/bin/development/opout
Moved from github
Diffstat (limited to '.local/bin/development/opout')
-rwxr-xr-x.local/bin/development/opout12
1 files changed, 12 insertions, 0 deletions
diff --git a/.local/bin/development/opout b/.local/bin/development/opout
new file mode 100755
index 0000000..3adc8fd
--- /dev/null
+++ b/.local/bin/development/opout
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+basename="${1%.*}"
+err() { printf "opout: %s\n" "$@" >&2; exit 1; }
+
+case "${*}" in
+ '') err "filename required" ;;
+ *.tex|*.sil|*.m[dse]|*.[rR]md|*.mom|*.[0-9]) target="$(getcomproot "$1" || echo "$1")" ; setsid -f "${OPENER:-xdg-open}" "${target%.*}".pdf >/dev/null 2>&1 ;;
+ *.html) setsid -f xdg-open "$basename".html >/dev/null 2>&1 ;;
+ *.sent) setsid -f sent "$1" >/dev/null 2>&1 ;;
+ *) err "file extension unmatched"
+esac