summaryrefslogtreecommitdiff
path: root/Completion/X
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/X')
-rw-r--r--Completion/X/Command/_setxkbmap10
-rw-r--r--Completion/X/Command/_zathura9
2 files changed, 10 insertions, 9 deletions
diff --git a/Completion/X/Command/_setxkbmap b/Completion/X/Command/_setxkbmap
index f7310ecdd..486268ed7 100644
--- a/Completion/X/Command/_setxkbmap
+++ b/Completion/X/Command/_setxkbmap
@@ -9,10 +9,12 @@ _setxkbmap() {
setopt extendedglob
# xkb files may be in different places depending on system
- local dir sourcedir
- for dir in /usr/lib/X11/xkb /usr/share/X11/xkb; do
- if [ -d $dir ] ; then
- sourcedir=$dir
+ local dir sourcedir fullname
+ local -a searchdirs=(${XDG_DATA_HOME:-~/.local/share} ${(s.:.)XDG_DATA_DIRS:-/usr/lib:/usr/share:/usr/local/lib:/usr/local/share})
+ for dir in $searchdirs; do
+ fullname="$dir/X11/xkb"
+ if [ -d $fullname ] ; then
+ sourcedir=$fullname
break
fi
done
diff --git a/Completion/X/Command/_zathura b/Completion/X/Command/_zathura
index 141cadf63..ebd229909 100644
--- a/Completion/X/Command/_zathura
+++ b/Completion/X/Command/_zathura
@@ -8,11 +8,10 @@ _zathura_files(){
${(Qv)opt_args[(i)-p|--plugins-dir]}(#qN) \
{/usr/local,/usr,}/lib/zathura(#qN)
do
- plugins_files=( $plugins_dir/*.so )
- (( $#plugins_files )) && break
+ plugins_files+=( $plugins_dir/*.so(N) )
done
if [[ -z "${plugins_files}" ]]; then
- _files -g "*.pdf(-.)"
+ _files -g "(#i)*.pdf(-.)"
return
fi
local -a supported_filetypes
@@ -25,10 +24,10 @@ _zathura_files(){
elif [[ $pf =~ "poppler" ]]; then
supported_filetypes+="pdf"
else
- supported_filetypes+="${${pf%.so}#${plugins_dir}/lib}"
+ supported_filetypes+="${pf:t:r}"
fi
done
- _files -g "*.(${(j.|.)supported_filetypes})(-.)"
+ _files -g "(#i)*.(${(j.|.)${(@u)supported_filetypes}})(-.)"
}
_arguments -s -S \