shellcheck, better automated upgrades
[distro-setup] / desktop-20-autostart.sh
index 842dab48bc37a4450f7a7c94a7ce0fef289ecce5..03be1c58356cb5c0d063977214a6b8bc2c871560 100755 (executable)
@@ -24,7 +24,7 @@ fi
 
 xout="$(xrandr)"
 xe() { echo "$xout"; }
-x=$(xe | grep -E '^(DisplayPort-[0123]|DVI-0|DP-[1234]|DVI-I-1) connected' | wc -l)
+x=$(xe | grep -Ec '^(DisplayPort-[0123]|DVI-0|DP-[1234]|DVI-I-1) connected')
 if (( x > 2 )); then
     left=$(xe | sed -rn 's/^(DVI[^ ]+) connected .*/\1/p')
     dps=( $(xe | sed -rn 's/^(DP-[01234]|DisplayPort-[01234]) connected .*/\1/p') )