rendered paste body#!/bin/bash
five_min_from_start=$(( $(date +%s) + 300 ))
./Test.py & daemonpid=$! & while true; do
#NUMBEROF=$(ps aux | grep -e "Test.py" | grep -v "grep" | awk '{ print $"2" }')
LAYOUT="Top"
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 $daemonpid || break # exit 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) + 300 ))
# bg %1 # uncomment this to unpause the py script after the 90 seconds, if you paused it.
fi
sleep 3s
done