]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - contrib/bash_completion/autorandr
Work around problems with autorandr's completion when using `bashcompinit`
[deb_pkgs/autorandr.git] / contrib / bash_completion / autorandr
index e7f098c1b4474db3596c2e659fbf74e80b469feb..03beabe9f2f87bdebe2e96f3f8e0bc8519dd24c1 100644 (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