Reply
Thread Tools
Posts: 7 | Thanked: 3 times | Joined on Dec 2008
#1
Is there any way to change IM (telepathy) status using the console command?

I was thinking about python D-Bus messaging... but it doesn't look easy to implement.

The idea is to change status based on wlan0 AP or even mac address of the AP. I know how to run the script at the wireless connection event. And I know how to check AP name or its mac address. But I really have no idea how to change IM status. Googling didn't give me the answer.

Any ideas?
 

The Following User Says Thank You to Vadi For This Useful Post:
Posts: 105 | Thanked: 62 times | Joined on Aug 2009 @ Finland
#2
At least there was a way with dbus, see: http://talk.maemo.org/showthread.php?p=425872

I think the interface names have changed a bit, so the old dbus command is not working. I haven't yet found the new one.
 
Posts: 7 | Thanked: 3 times | Joined on Dec 2008
#3
Thanks for the link.
I've used /usr/bin/dbus-monitor to look at D-Bus events. It turned out that there is no CM destination implementation in current telepathy (Maemo 5). And it looks like you'll have to send the D-Bus message to each account you have in telepathy separately.
To do that, I guess, I need to read D-Bus manuals first... It's not that intuitive as I want it to be. Anyway, I'll keep you updated as soon as I'll figure out how this thing works.
 

The Following User Says Thank You to Vadi For This Useful Post:
Posts: 729 | Thanked: 155 times | Joined on Dec 2009
#4
Originally Posted by Petteri View Post
At least there was a way with dbus, see: http://talk.maemo.org/showthread.php?p=425872

I think the interface names have changed a bit, so the old dbus command is not working. I haven't yet found the new one.
I would like to change the status of the accounts when on WiFi so I am looking for D-BUS method but this one doesn't work with Fremantle. Does anyone know a working solution?
 
Posts: 729 | Thanked: 155 times | Joined on Dec 2009
#5
I have used the dbus-monitor when changing the global status for all accounts to "Busy" and the first lines look like this:
Code:
signal sender=org.freedesktop.DBus -> dest=:1.174 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.174"
method call sender=:1.174 -> dest=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='method_call'"
method call sender=:1.174 -> dest=org.freedesktop.DBus serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='method_return'"
method call sender=:1.174 -> dest=org.freedesktop.DBus serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='error'"
method call sender=:1.27 -> dest=org.freedesktop.DBus serial=549 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='com.nokia.AccountsUI',path='/com/nokia/AccountsUI',interface='com.nokia.Accounts'"
method call sender=:1.27 -> dest=org.freedesktop.DBus serial=550 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='com.nokia.AccountsUI'"
method call sender=:1.27 -> dest=org.freedesktop.DBus serial=552 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='com.nokia.AccountsUI',path='/com/nokia/AccountsUI',interface='com.nokia.Accounts'"
method call sender=:1.27 -> dest=org.freedesktop.DBus serial=553 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='com.nokia.AccountsUI'"
I also found http://maemo.org/packages/package_in...t0/4.84-1+0m5/ but no documentation. Does someone know how to change the status for the accounts with a shell script?
Thanks.
 

The Following User Says Thank You to DaSilva For This Useful Post:
Posts: 7 | Thanked: 3 times | Joined on Dec 2008
#6
command should look like something like this:
Code:
run-standalone.sh dbus-send --print-reply --type=method_call --dest=org.freedesktop.Telepathy.AccountManager /org/freedesktop/Telepathy/Account/gabble/jabber/YOURACCOUNT_40gmail_2ecom0 org.freedesktop.DBus.Properties.Set string:"org.freedesktop.Telepathy.Account" string:"RequestedPresence" uint32:1 string:"offline" string:"newStatus"
well, not exactly... last three variables suppose to be in one variant struct {uint32:1 string:"offline" string:"newStatus"}
And I have no idea how to put them there for dbus-send.

We are looking for:
Code:
dest=org.freedesktop.Telepathy.AccountManager serial=4835 path=/org/freedesktop/Telepathy/Account/gabble/jabber/YOURACCOUNT_40gmail_2ecom0; interface=org.freedesktop.DBus.Properties; member=Set
   string "org.freedesktop.Telepathy.Account"
   string "RequestedPresence"
   variant       struct {
         uint32 1
         string "offline"
         string "@Home"
      }
by dbus-monitor.

Last edited by Vadi; 2010-01-07 at 06:28.
 
Posts: 729 | Thanked: 155 times | Joined on Dec 2009
#7
Thanks for the answer.
With your solution you would have to add it for every single account.
Isn't it possible to do it for all enabled accounts with one command?
That would be better because everyone could use the same script.
 
Posts: 14 | Thanked: 10 times | Joined on Oct 2009
#8
Originally Posted by DaSilva View Post
With your solution you would have to add it for every single account.
Isn't it possible to do it for all enabled accounts with one command?
You could get a list of all accounts with the following and then iterate over them:

Code:
/usr/bin/dbus-send --type=method_call --print-reply --dest=org.freedesktop.Telepathy.AccountManager /org/freedesktop/Telepathy/AccountManager org.freedesktop.DBus.Properties.Get string:org.freedesktop.Telepathy.AccountManager string:ValidAccounts
 

The Following 2 Users Say Thank You to mavit For This Useful Post:
Posts: 61 | Thanked: 60 times | Joined on Jul 2007 @ Erlangen
#9
beside dbus there is also a tool called mc-tool i think. Its part of the osso-mission-control package and can be used to setup, modify or manage the IM accounts. No idea if it's supported to be used in any way, on n800 I used it to set a dedicated network interface for a sip account (tun0 instead of wlan0). On n900 i had it installed but only used it to list the configured accounts up to now. Unfortunately i just had to reflash my n900, so i can't test if it can be used to actually change the status.
 
Posts: 540 | Thanked: 387 times | Joined on May 2009
#10
A bit off-topic, but on the N8X0,
I use Pidgin + Conler Connection Handler + purple-remote "setstatus?status=away&message=I'm not here" which works for me. I also use pidgin --l=SCREENNAME with Conler. Also if you want a different approach then dbus-scripts-settings may help. Just throwing that stuff out there.
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:38.