zathura/data/bash-completion.in

29 lines
635 B
Plaintext
Raw Normal View History

#!/bin/bash
2018-05-22 09:21:14 +02:00
_zathura() {
_init_completion 2>/dev/null || true
2018-05-22 09:21:14 +02:00
local EXTS=""
for PLUGIN in @PLUGINDIR@/lib*.so; do
case ${PLUGIN##*/} in
libpdf-poppler.so)
2019-02-03 15:28:08 +01:00
EXTS="$EXTS|pdf|PDF"
2018-05-22 09:21:14 +02:00
;;
libpdf-mupdf.so)
2019-02-03 15:28:08 +01:00
EXTS="$EXTS|pdf|PDF|epub|oxps"
2018-05-22 09:21:14 +02:00
;;
libps.so)
EXTS="$EXTS|ps|eps|epsi|epsf"
;;
libdjvu.so)
EXTS="$EXTS|djvu|djv"
;;
libcb.so)
EXTS="$EXTS|cb7|cbr|cbz|cbt|rar|zip|7z|tar"
;;
2019-02-03 15:28:00 +01:00
esac
2018-05-22 09:21:14 +02:00
done
_filedir "${EXTS#|}" 2>/dev/null || COMPREPLY=($(shopt -s extglob; compgen -f -X "!*.@($EXTS)"))
2018-05-22 09:21:14 +02:00
}
complete -F _zathura zathura