Active Topics

 


Reply
Thread Tools
Posts: 569 | Thanked: 462 times | Joined on Jul 2010 @ USA
#1
Is there a command line entry that returns a value that can be used to determine if the N900 is in Silent or General profile?

I am using a timed shell script which calls play-sound to play clock chimes, the disadvantage of which is that play-sound will always play, even when the phone's profile is set to Silent.

I need something to exit or otherwise control the shell script, along the lines of
if {
IsProfileSilent() == true
} exit;

Last edited by rotoflex; 2012-01-19 at 08:26. Reason: Corrected from reference to "aplay" to "play-sound"
 
Zas's Avatar
Posts: 196 | Thanked: 113 times | Joined on Jun 2010 @ Finland
#2
cat /home/user/.profiled/current

Returns "silent" or "general".
 

The Following 3 Users Say Thank You to Zas For This Useful Post:
Posts: 2,102 | Thanked: 1,937 times | Joined on Sep 2008 @ Berlin, Germany
#3
Did you try, if TimedSilencer can do 'something' for you?
 
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#4
This is the Rosetta stone you seek.
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following User Says Thank You to vi_ For This Useful Post:
Posts: 569 | Thanked: 462 times | Joined on Jul 2010 @ USA
#5
Originally Posted by Zas View Post
Returns "silent" or "general".
Thank you!

How would I capture & compare that string returned within a shell script? I am not very familiar with shell scripting.

-----


Originally Posted by michaaa62
Did you try, if TimedSilencer can do 'something' for you?
Thank you, but I am trying to localize this within an existing shell script.

vi_ : Thank you. I see that
Code:
dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_profile
also returns the profile, but in a more verbose statement.
I think in this case only the "silent" or "general" returned by
Code:
cat /home/user/.profiled/current
would be easier to work with.
 
Posts: 992 | Thanked: 738 times | Joined on Jun 2010 @ Low Earth Orbit
#6
Something like:

Code:
if [ `cat /home/user/.profiled/current` == "Outdoors" ]; then echo "Not inside";fi
should work.
 

The Following 2 Users Say Thank You to kureyon For This Useful Post:
Posts: 569 | Thanked: 462 times | Joined on Jul 2010 @ USA
#7
Thank you all; it seems to have worked with
Code:
if [ `cat /home/user/.profiled/current` == "silent" ]; then
exit 1
fi
 
Reply


 
Forum Jump


All times are GMT. The time now is 10:37.