run x-monitors twice

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-11-13 17:56:17 +01:00
parent 7a9c5c4aea
commit da47c366c7

View file

@ -32,6 +32,13 @@ main="$(cat ~/.x-monitors-main)"
positions="left-of right-of above below"
prefix=".x-monitors-"
i=0
# Needs to run twice: xrandr may not be able to
# enable a newly connected monitor, because a disconnected one
# is still enabled. The first runs disables disconnected monitors, the
# second one enables all connected ones.
while [ "${i}" -lt 2 ]; do
# search for all possible monitors in all positions
for position in $positions; do
posfile="${HOME}/${prefix}${position}"
@ -41,3 +48,6 @@ for position in $positions; do
done < "${posfile}"
fi
done
i=$(($i+1))
done