]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Merge pull request #146 from Ma27/fix-bashcomp-with-zsh
authorPhillip Berndt <phillip.berndt@googlemail.com>
Sun, 24 Mar 2019 19:50:33 +0000 (20:50 +0100)
committerGitHub <noreply@github.com>
Sun, 24 Mar 2019 19:50:33 +0000 (20:50 +0100)
Work around problems with autorandr's completion when using `bashcompinit`

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