Merge pull request #146 from Ma27/fix-bashcomp-with-zsh

Work around problems with autorandr's completion when using `bashcompinit`
This commit is contained in:
Phillip Berndt 2019-03-24 20:50:33 +01:00 committed by GitHub
commit 669ca1146e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,9 +29,9 @@ _autorandr ()
AR_DIRS=( "${AR_DIRS[@]}" "${XDG_CONFIG_HOME:-$HOME/.config}/autorandr/" )
fi
if [ -n "${AR_DIRS}" ]
if [ "${#AR_DIRS[@]}" -gt 0 ]
then
prfls="$(find "${AR_DIRS[@]}" -mindepth 1 -maxdepth 1 -type d ! -name "*.d" -printf '%f\n' | sort -u)"
prfls="$(find "${AR_DIRS[@]}" -mindepth 1 -maxdepth 1 -type d ! -name "*.d" -printf '%f\n' 2>/dev/null | sort -u)"
else
prfls=""
fi