kushal.kumaran |
2010-09-12 09:57 |
Ring for certain contacts even on Silent
I was looking for a way to make my phone (N900) ring for certain contacts even if a Silent profile is selected. Some preliminary googling did not lead to anything, so I rolled my own. Here's what I came up with:
- install dbus-scripts
- create a file /etc/dbus-scripts.d/ring-important with the following contents:
Code:
/home/user/bin/ring-important * * com.nokia.csd.Call Coming
- create a file /home/user/bin/ring-important with the following contents:
Code:
#!/bin/sh
INCOMING_NUMBER="$5"
IMPORTANT_NUMBERS="/home/user/important-numbers"
if fgrep -q $INCOMING_NUMBER $IMPORTANT_NUMBERS; then
run-standalone.sh dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"general"
fi
- set the script's executable bit:
Code:
chmod +x /home/user/bin/ring-important
- create a file /home/user/important-numbers with a list of phone numbers you'd like to ring even if the phone is set to Silent, one phone number to a line
- restart dbus-scripts:
Code:
killall dbus-scripts
This will set the profile to General whenever there's an incoming call from one of the numbers listed in /home/user/important-numbers. The profile stays at General after the call is finished.
Hope someone finds this useful.
|