mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 18:03:47 +01:00
Include bash-completion
This commit is contained in:
parent
752d408c4b
commit
11da8e7c8e
27
data/bash-completion.in
Normal file
27
data/bash-completion.in
Normal file
@ -0,0 +1,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
|
@ -44,3 +44,13 @@ if appstream_util.found()
|
||||
args: ['validate-relax', appdata.full_path()]
|
||||
)
|
||||
endif
|
||||
|
||||
conf_data = configuration_data()
|
||||
conf_data.set('PLUGINDIR', join_paths(prefix, plugindir))
|
||||
bash_completion = configure_file(
|
||||
input: 'bash-completion.in',
|
||||
output: 'zathura',
|
||||
configuration: conf_data
|
||||
)
|
||||
|
||||
install_data(bash_completion, install_dir: join_paths(datadir, 'bash-completion', 'completions'))
|
||||
|
Loading…
Reference in New Issue
Block a user