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 #!/bin/ksh
# #
# v0.3 - 15/08/2023 # 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: # Dependencias:
# pdf: zathura (GUI), pdftotext # pdf: zathura (GUI), pdftotext
@ -71,7 +71,7 @@ function handle_pdf {
else else
pdftotext -l 10 -nopgbrk -q -- "${FPATH}" - | eval "$PAGER" pdftotext -l 10 -nopgbrk -q -- "${FPATH}" - | eval "$PAGER"
fi fi
return 0 exit 0
} }
function handle_audio { function handle_audio {
@ -82,7 +82,7 @@ function handle_audio {
elif type exiftool >/dev/null 2>&1; then elif type exiftool >/dev/null 2>&1; then
open_with_converter exiftool open_with_converter exiftool
fi fi
return 0 exit 0
} }
function handle_video { function handle_video {
@ -91,7 +91,7 @@ function handle_video {
else else
open_with_converter exiftool open_with_converter exiftool
fi fi
return 0 exit 0
} }
function handle_image { function handle_image {
@ -100,14 +100,14 @@ function handle_image {
elif type viu >/dev/null 2>&1; then elif type viu >/dev/null 2>&1; then
open_with_converter viu -n open_with_converter viu -n
fi fi
return 0 exit 0
} }
function handle_html { function handle_html {
if [[ -n $DISPLAY ]]; then if [[ -n $DISPLAY ]]; then
open_with_converter w3m -dump open_with_converter w3m -dump
fi fi
return 0 exit 0
} }
case "${ext}" in case "${ext}" in
@ -131,7 +131,7 @@ case "${ext}" in
exit 1;; exit 1;;
## Video ## Video
avi|mkv|mp4) avi|mkv|mp4|mov)
handle_video handle_video
exit 1;; exit 1;;
@ -154,6 +154,14 @@ case "${ext}" in
fi fi
exit 1;; 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 ## Markdown
md) md)
if type glow >/dev/null 2>&1; then if type glow >/dev/null 2>&1; then