Avoid double multiple runs

parent 9709ca77
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
timeout=10 timeout=10
DEBUG=true DEBUG=true
interaction=true interaction=true
echo "" > /var/log/vp.log
log(){ log(){
if $DEBUG if $DEBUG
then then
...@@ -69,11 +70,18 @@ screens=$(xrandr | grep " connected" | cut -f 1 -d ' ' \ ...@@ -69,11 +70,18 @@ screens=$(xrandr | grep " connected" | cut -f 1 -d ' ' \
| sed -e 's/ /\n/g' | grep -v "\<$MAIN_SCREEN\>") | sed -e 's/ /\n/g' | grep -v "\<$MAIN_SCREEN\>")
log "SCREENS '$screens'" log "SCREENS '$screens'"
log "all '$screens$MAIN_SCREEN'"
log "cat '$(cat /tmp/vp-screens)'"
if [ -z "$screens$MAIN_SCREEN" ] if [ -z "$screens$MAIN_SCREEN" ]
then then
log "noscreens exiting on $(date)" log "noscreens exiting on $(date)"
exit exit
elif [ "$screens$MAIN_SCREEN" == "$(cat /tmp/vp-screens)" ]
then
log "no changes exiting on $(date)"
exit
fi fi
echo "$screens$MAIN_SCREEN" > /tmp/vp-screens
clone(){ clone(){
# Auto detect best resolution # Auto detect best resolution
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment