diff options
Diffstat (limited to 'bin/opener')
-rwxr-xr-x | bin/opener | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/bin/opener b/bin/opener index 755da51..4ae3446 100755 --- a/bin/opener +++ b/bin/opener @@ -13,27 +13,19 @@ echo() { case "$FILEMIME" in #ebooks application/epub*|application/pdf|application/postscript|image/vnd.djvu) - if [ -n "$READER" ]; then - $READER "$FILEPATH">/dev/null 2>&1 & - else - zathura "$FILEPATH" & - fi ;; + ${READER:-zathura} "$FILEPATH">/dev/null 2>&1 & ;; #videos video/*) - mpv --input-ipc-server=/tmp/mpv-socket$(date +%s) --quiet "$FILEPATH" >/dev/null 2>&1 & ;; + mpv --quiet "$FILEPATH" >/dev/null 2>&1 & ;; #images image/*) sxiv -a "$FILEPATH">/dev/null 2>&1 & ;; #audio audio/*) - mpv --input-ipc-server=/tmp/mpv-socket$(date +%s) "$FILEPATH" >/dev/null 2>&1 & ;; + mpv "$FILEPATH" >/dev/null 2>&1 & ;; #text text/*) - if [ -n "$EDITOR" ]; then - $EDITOR "$FILEPATH">/dev/null 2>&1 & - else - vi "$FILEPATH" & - fi ;; + ${EDITOR:-vi} "$FILEPATH">/dev/null 2>&1 & ;; #catchall *) echo "file $(basename "$FILEPATH") could not be opened. its type is $FILEMIME, go tell ensa that opener didn't work" >/dev/stderr |