From 624219e0e4cbfdfb286e707bd2853f2d7b6a4a7d Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 19 Sep 2018 22:36:17 +0200 Subject: 43502: Search XDG_DATA_DIRS in _setxkbmap completion --- Completion/X/Command/_setxkbmap | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Completion/X') 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 -- cgit 1.4.1