
Ah

Well it was worth doing some shell script syntax recap.
here is the shorter one using the event:
Code:
#!/bin/bash
echo "com.lab126.powerd" |lipc-wait-event -m -l "readyToSuspend" | while read event; do
g=`echo $event*| grep "readyToSuspend"`
if [ ! -z "$g" ]
then
lipc-set-prop com.lab126.powerd deferSuspend 3000000
fi
done
Feel free to make optimisations