#!/bin/bash
# change this to alter the heartbeat speed (lower = quicker)
beat_time=2;
# get a good guess about the windows that are visible
WINDOWS=`xwininfo -root -children | grep -v "+0+0" | grep -v "no name" | awk '{ print $1 }' | grep ^0x | uniq -u`;
#echo $WINDOWS;
# find out which windows have map state IsViewable
for window in $WINDOWS ; do
wininfo=`xwininfo -id $window | grep "IsViewable" | wc -l`
if [ "$wininfo" -eq "1" ]; then
visible="$visible $window";
fi
done
#echo $visible;
# start the heartbeat
while [ 1 ] ; do
for vwin in $visible ; do
`dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/wobbly/allscreens/shiver org.freedesktop.compiz.activate string:'root' int32:0x52 string:'window' int32:$vwin`;
`dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/wobbly/allscreens/shiver org.freedesktop.compiz.activate string:'root' int32:0x52 string:'window' int32:$vwin`;
`dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/wobbly/allscreens/shiver org.freedesktop.compiz.activate string:'root' int32:0x52 string:'window' int32:$vwin`;
done
sleep 0.3
for vwin in $visible ; do
`dbus-send --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/wobbly/allscreens/shiver org.freedesktop.compiz.activate string:'root' int32:0x52 string:'window' int32:$vwin`;
done
sleep $beat_time
done