bash-completion.in 531 Bytes
Newer Older
Sebastian Ramacher's avatar
Sebastian Ramacher committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
_zathura() {
  _init_completion || return

  local EXTS=""
  for PLUGIN in @PLUGINDIR@/lib*.so; do
    case ${PLUGIN##*/} in
      libpdf-poppler.so)
        EXTS="$EXTS|pdf"
        ;;
      libpdf-mupdf.so)
        EXTS="$EXTS|pdf|epub|oxps"
        ;;
      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"
        ;;
      esac
  done

  _filedir "${EXTS#|}"
}
complete -F _zathura zathura