|
|
@@ -79,12 +79,19 @@ FNAME=$(basename "$1") |
|
|
|
EDITOR="${EDITOR:-vi}" |
|
|
|
PAGER="${PAGER:-less -R}" |
|
|
|
ext="${FNAME##*.}" |
|
|
|
if ! [ -z "$ext" ]; then |
|
|
|
if [ -n "$ext" ]; then |
|
|
|
ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')" |
|
|
|
fi |
|
|
|
|
|
|
|
is_mac() { |
|
|
|
uname | grep -q "Darwin" |
|
|
|
} |
|
|
|
|
|
|
|
handle_pdf() { |
|
|
|
if [ "$GUI" -ne 0 ] && which zathura >/dev/null 2>&1; then |
|
|
|
if [ "$GUI" -ne 0 ] && is_mac; then |
|
|
|
open "${FPATH}" >/dev/null 2>&1 & |
|
|
|
exit 0 |
|
|
|
elif [ "$GUI" -ne 0 ] && which zathura >/dev/null 2>&1; then |
|
|
|
zathura "${FPATH}" >/dev/null 2>&1 & |
|
|
|
exit 0 |
|
|
|
elif which pdftotext >/dev/null 2>&1; then |
|
|
@@ -120,7 +127,10 @@ handle_audio() { |
|
|
|
} |
|
|
|
|
|
|
|
handle_video() { |
|
|
|
if [ "$GUI" -ne 0 ] && which smplayer >/dev/null 2>&1; then |
|
|
|
if [ "$GUI" -ne 0 ] && is_mac; then |
|
|
|
open "${FPATH}" >/dev/null 2>&1 & |
|
|
|
exit 0 |
|
|
|
elif [ "$GUI" -ne 0 ] && which smplayer >/dev/null 2>&1; then |
|
|
|
smplayer "${FPATH}" >/dev/null 2>&1 & |
|
|
|
exit 0 |
|
|
|
elif [ "$GUI" -ne 0 ] && which mpv >/dev/null 2>&1; then |
|
|
@@ -294,7 +304,10 @@ handle_multimedia() { |
|
|
|
|
|
|
|
## Image |
|
|
|
image/*) |
|
|
|
if [ "$GUI" -ne 0 ] && which imvr >/dev/null 2>&1; then |
|
|
|
if [ "$GUI" -ne 0 ] && is_mac; then |
|
|
|
open "${FPATH}" >/dev/null 2>&1 & |
|
|
|
exit 0 |
|
|
|
elif [ "$GUI" -ne 0 ] && which imvr >/dev/null 2>&1; then |
|
|
|
load_dir imvr "${FPATH}" >/dev/null 2>&1 & |
|
|
|
exit 0 |
|
|
|
elif [ "$GUI" -ne 0 ] && which sxiv >/dev/null 2>&1; then |
|
|
|