run x-monitors twice
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
parent
7a9c5c4aea
commit
da47c366c7
1 changed files with 18 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue