summaryrefslogtreecommitdiff
path: root/community/zathura/bash-completion
diff options
context:
space:
mode:
Diffstat (limited to 'community/zathura/bash-completion')
-rw-r--r--community/zathura/bash-completion29
1 files changed, 29 insertions, 0 deletions
diff --git a/community/zathura/bash-completion b/community/zathura/bash-completion
new file mode 100644
index 000000000..41c3825b6
--- /dev/null
+++ b/community/zathura/bash-completion
@@ -0,0 +1,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