That set me onto the right path! But dang it was hard for me to find out anything remotely resembling documentation! I first find
ed any com.nokia.profiled
files, ended up finding profiled.service
systemd system service file, which in turn just starts /usr/bin/profiled
(which outputs nothing with ´–help´). Armed with that binary name, I googled my way to its source code using which I was finally able to, uh, nothing. I don’t know DBus…
But then I found this lovely page in Maemo wiki! Using that as a template I was finally able to come up with something useful!
First I have to check the active profile:
$ dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_profile
string "general"
Then I can query the actual ringtone volume (until the response was silent
which automatically means: don’t make a sound):
dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_value string:"general" string:"ringing.alert.volume"
string "60"
So there you go. This is how you can query the active profile and get the ringtone volume. Another interesting query was listing the profiles:
$ dbus-send --type=method_call --print-reply --dest=com.nokia.profiled /com/nokia/profiled
com.nokia.profiled.get_profiles
array [
string "ambience"
string "general"
string "meeting"
string "outdoors"
string "silent"
]
So far I have been able to set only general
and silent
. If the volume is not zero, the profile is general
. If the Silent top-menu button is activated, or volume slider dragged to zero, the profile is switched to silent
without the general
volume getting set. So it’s a bit illogical, but at least I got that figured out before I got into actually writing the code for this!
I think I have earned a beer.