View Single Post
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#5
This might of some help, part of out-call-vibro
Code:
MohammadAG-N900:~# cat /usr/bin/out-call-vibro.sh 
#!/bin/sh


if [ -f /var/run/out-call-vibro/out-call-vibro.pid ]
then
	echo Process is already running...
	exit 1
fi

echo $$ > /var/run/out-call-vibro/out-call-vibro.pid


vibro() {
	if grep -q "Call answered"; then
	    if [ `cat /sys/devices/platform/gpio-switch/proximity/state` = "open" ]; then
	       echo 150 > /sys/class/leds/twl4030:vibrator/brightness
	       gsleep 0.5
	       echo 0 > /sys/class/leds/twl4030:vibrator/brightness
	    fi
	fi
	}

monitor() {
          dbus-monitor --session type='signal',interface='org.freedesktop.Telepathy.Channel.Interface.Group',member='MembersChanged' | while read line ; do vibro ; done
          }

monitor

# End
 

The Following 4 Users Say Thank You to MohammadAG For This Useful Post: