#!/bin/bash
five_min_from_start=$(( $(date +%s) + 300 ))
./Test.py &
while true; do
LAYOUT="Top"
# You could really clean up the next five lines with some decent use of
# parameter expansions and awk...
WINFO=$(xwininfo -root -tree -name "$LAYOUT Panel"| grep "pidgin" | cut -d ')' -f 2-)
WIW=$(echo $WINFO | cut -d 'x' -f 1)
WIH=$(echo $WINFO | cut -d 'x' -f 2 | cut -d '+' -f 1)
WIX=$(echo $WINFO | cut -d '+' -f 4)
WIY=$(echo $WINFO | cut -d '+' -f 5)
let WAX=WIX+WIW/2
let WAY=WIY+WIH/2
dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/water/allscreens/point org.freedesktop.compiz.activate string:'root' int32:`xwininfo -root | grep id: | awk '{ print $4 }'` string:'amplitude' double:1 string:'x' int32:$WAX string:'y' int32:$WAY
kill -0 %1 || break # exit the loop if the py script is done
if (( five_min_from_start < $(date +%s) )); then
# kill -STOP %1 # uncomment this to pause the py script for the duration of the 90 seconds
sleep 90
five_min_from_start=$(date +%s)
# bg %1 # uncomment this to unpause the py script after the 90 seconds, if you paused it.
fi
done