summaryrefslogtreecommitdiff
path: root/community-testing/zathura/bash-completion
blob: 41c3825b6b33166fdedddcf0dbf58dfd0e8204f2 (plain)
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
28
29
_zathura() {
  _init_completion || return

  EXTENTIONS=''
  for PLUGIN in /usr/lib/zathura/*.so; do
    case ${PLUGIN##*/} in
      pdf.so)
        EXTENTIONS="$EXTENTIONS|pdf"
        ;;
      ps.so)
        EXTENTIONS="$EXTENTIONS|ps|eps|epsi|epsf"
        ;;
      djvu.so)
        EXTENTIONS="$EXTENTIONS|djvu|djv"
        ;;
      epub.so)
        EXTENTIONS="$EXTENTIONS|epub"
        ;;
      cb.so)
        EXTENTIONS="$EXTENTIONS|cb7|cbr|cbz|cbt|rar|zip|7z|tar"
        ;;
      *)
        ;;
      esac
  done

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