summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2021-04-11 17:19:14 +0100
committerdakkar <dakkar@thenautilus.net>2021-04-11 17:19:14 +0100
commit219df667c9e2a7a30a5babdb84e2f0bba5b73388 (patch)
tree747f1fd8c6067529ea85c591708b25e7de975835
parentno more hal-automounter, use dmount (diff)
downloaddotfiles-219df667c9e2a7a30a5babdb84e2f0bba5b73388.tar.gz
dotfiles-219df667c9e2a7a30a5babdb84e2f0bba5b73388.tar.bz2
dotfiles-219df667c9e2a7a30a5babdb84e2f0bba5b73388.zip
make my bashcomp actually work
-rw-r--r--.bash_completion11
-rw-r--r--.bash_completion.d/dmount.bashcomp7
-rw-r--r--.bash_completion.d/mupdf.bashcomp25
-rw-r--r--.bash_completion.d/pd.bashcomp2
l---------.bash_completion.d/website.bashcomp1
5 files changed, 44 insertions, 2 deletions
diff --git a/.bash_completion b/.bash_completion
index 4eb8044..0dd54ff 100644
--- a/.bash_completion
+++ b/.bash_completion
@@ -1,2 +1,9 @@
-_xfunc perl _perldoc
-complete -F _perldoc -o bashdefault pm pd
+# -*- mode: sh -*-
+
+bcdir="$HOME/.bash_completion.d"
+if [[ -d "$bcdir" && -r "$bcdir" && -x "$bcdir" ]]; then
+ for i in "$bcdir"/*.bashcomp; do
+ [[ -f $i && -r $i ]] && . "$i"
+ done
+fi
+
diff --git a/.bash_completion.d/dmount.bashcomp b/.bash_completion.d/dmount.bashcomp
new file mode 100644
index 0000000..adbd251
--- /dev/null
+++ b/.bash_completion.d/dmount.bashcomp
@@ -0,0 +1,7 @@
+# -*- mode: sh -*-
+
+_dmount_list() {
+ COMPREPLY=( $(dmount --list) )
+}
+
+complete -F _dmount_list dmount
diff --git a/.bash_completion.d/mupdf.bashcomp b/.bash_completion.d/mupdf.bashcomp
new file mode 100644
index 0000000..dd02b65
--- /dev/null
+++ b/.bash_completion.d/mupdf.bashcomp
@@ -0,0 +1,25 @@
+# mupdf(1) completion -*- shell-script -*-
+
+_mupdf()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ --help*|-h|-p|-r|-W|-H|-S|-U|-x)
+ return
+ ;;
+ esac
+
+ $split && return
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' \
+ -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return
+ fi
+
+ _filedir '@(@(?(e)ps|?(E)PS|[pf]df|[PF]DF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2|.xz|.XZ)|cb[rz]|djv?(u)|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|epub)'
+} &&
+complete -F _mupdf mupdf
diff --git a/.bash_completion.d/pd.bashcomp b/.bash_completion.d/pd.bashcomp
new file mode 100644
index 0000000..4eb8044
--- /dev/null
+++ b/.bash_completion.d/pd.bashcomp
@@ -0,0 +1,2 @@
+_xfunc perl _perldoc
+complete -F _perldoc -o bashdefault pm pd
diff --git a/.bash_completion.d/website.bashcomp b/.bash_completion.d/website.bashcomp
new file mode 120000
index 0000000..cd8d05a
--- /dev/null
+++ b/.bash_completion.d/website.bashcomp
@@ -0,0 +1 @@
+/home/dakkar/website/thenautilus/website.bashcomp \ No newline at end of file