1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 10:01:11 +02:00

43502: Search XDG_DATA_DIRS in _setxkbmap completion

This commit is contained in:
Maximilian Bosch 2018-09-19 22:36:17 +02:00 committed by Daniel Shahaf
parent 54d2c4fe5d
commit 624219e0e4
2 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2018-09-19 Maximilian Bosch <maximilian@mbosch.me>
* 43502: Completion/X/Command/_setxkbmap: Search XDG_DATA_DIRS
in _setxkbmap completion
2018-09-18 Oliver Kiddle <okiddle@yahoo.co.uk>
* 43464: Completion/Linux/Command/_valgrind: complete options

View file

@ -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