sudo nano /usr/local/bin/waterping.sh |
#!/bin/bash if [ -z "$1" ]; then echo "kopete"; exit 0 fi win=`xwininfo -root -tree | grep "$1" | egrep '[1-4][0-9]x[1-4][0-9]\+0\+0' | cut -d ')' -f 2-` if [ -z "$win" ]; then echo "Ikonka nenalezena"; exit 0 fi w=`echo $win | cut -d 'x' -f 1` h=`echo $win | cut -d 'x' -f 2 | cut -d '+' -f 1` x=`echo $win | cut -d '+' -f 4` y=`echo $win | cut -d '+' -f 5` let x=x+w/2 let y=y+h/2 count=`echo $2 | grep ^[0-9]\\\+$` if ! [ $count ]; then count=1; fi; sleep=`echo $3 | grep ^[0-9]\\\+$` if ! [ $sleep ]; then sleep=2; fi; while [ ${ti=0} -ne $count ]; do ti=$((ti + 1)) 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:$x string:'y' int32:$y if [ $ti -lt $count ]; then sleep $sleep; fi; done |
sudo chmod +x /usr/local/bin/waterping.sh |
sudo nano /usr/local/bin/waterping_kopete.sh |
#!/bin/bash esdplay $1 & waterping.sh kopete & |
sudo chmod +x /usr/local/bin/waterping_kopete.sh |
sudo apt-get install esound-clients |
waterping.sh kopete |
/usr/local/bin/waterping_kopete.sh |