Unverified Commit 31fecd9e authored by David Beniamine's avatar David Beniamine
Browse files

Avoid double multiple runs

parent 59a6589d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
timeout=10
DEBUG=true
interaction=true
echo "" > /var/log/vp.log
log(){
    if $DEBUG
    then
@@ -69,11 +70,18 @@ screens=$(xrandr | grep " connected" | cut -f 1 -d ' ' \
    | sed -e 's/ /\n/g' | grep -v "\<$MAIN_SCREEN\>")

log  "SCREENS '$screens'"
log  "all '$screens$MAIN_SCREEN'"
log  "cat '$(cat /tmp/vp-screens)'"
if [ -z "$screens$MAIN_SCREEN" ]
then
    log  "noscreens exiting on $(date)"
    exit
elif [ "$screens$MAIN_SCREEN" == "$(cat /tmp/vp-screens)" ]
then
    log "no changes exiting on $(date)"
    exit
fi
echo "$screens$MAIN_SCREEN" > /tmp/vp-screens

clone(){
    # Auto detect best resolution