opener.ksh: Correcciones de descripción y código

Se corrige descripción del script, cambios menores de códigos de salida y se añade código para apertura de archivos de Microsoft Office
This commit is contained in:
Tuxliban Torvalds 2023-09-15 19:40:06 -06:00
parent 8dbaf6c412
commit 42a5386a92
1 changed files with 15 additions and 7 deletions

View File

@ -1,7 +1,7 @@
#!/bin/ksh
#
# v0.3 - 15/08/2023
# Opener personalizado inspirado en el plugin preview-tabbed de nnn.
# Opener personalizado inspirado en el plugin 'nuke' de nnn.
#
# Dependencias:
# pdf: zathura (GUI), pdftotext
@ -71,7 +71,7 @@ function handle_pdf {
else
pdftotext -l 10 -nopgbrk -q -- "${FPATH}" - | eval "$PAGER"
fi
return 0
exit 0
}
function handle_audio {
@ -82,7 +82,7 @@ function handle_audio {
elif type exiftool >/dev/null 2>&1; then
open_with_converter exiftool
fi
return 0
exit 0
}
function handle_video {
@ -91,7 +91,7 @@ function handle_video {
else
open_with_converter exiftool
fi
return 0
exit 0
}
function handle_image {
@ -100,14 +100,14 @@ function handle_image {
elif type viu >/dev/null 2>&1; then
open_with_converter viu -n
fi
return 0
exit 0
}
function handle_html {
if [[ -n $DISPLAY ]]; then
open_with_converter w3m -dump
fi
return 0
exit 0
}
case "${ext}" in
@ -131,7 +131,7 @@ case "${ext}" in
exit 1;;
## Video
avi|mkv|mp4)
avi|mkv|mp4|mov)
handle_video
exit 1;;
@ -154,6 +154,14 @@ case "${ext}" in
fi
exit 1;;
## Winbugs documents
doc|docx|xls|xlsx|ppt|pptx)
if type soffice >/dev/null 2>&1; then
soffice --nologo "${@}" >/dev/null 2>&1 &
exit 0
fi
exit 1;;
## Markdown
md)
if type glow >/dev/null 2>&1; then