maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Auto-set Skype availability to Busy when phone is locked? (https://talk.maemo.org/showthread.php?t=48239)

shallimus 2010-03-24 21:23

Auto-set Skype availability to Busy when phone is locked?
 
I like that my phone can be always online. However, it spends considerably more time on the internet than I do, i.e. I have a significantly reduced interest in receiving Skype/Google Talk etc. messages/calls when I am sleeping/working/otherwise engaged. Often my friends assume I am online and waiting for someone to talk to me just because they see my status as 'Online'.

My question is: is there a way to cause the N900 to set my Availability to 'Busy' or some other status when the phone locks?

I have mine set to autolock after 30 minutes, and at this point I would like the phone to set my availability to Busy (or possibly even offline). By extension, this would only really be useful if my status then reset to 'Available' (or whatever) when I unlock the phone.

I have poked about in the settings, read the FAQ & suggested threads, searched the forums and have googled the entire interweb without finding an answer to my question. If I have missed something obvious, please let me know [gently] :)

TomJ 2010-03-24 23:57

Re: Auto-set Skype availability to Busy when phone is locked?
 
I don't think there's an obvious way. It may be something that's acheivable using dbus scripts? Might be worth asking in this thread.

jorjino 2010-03-25 05:08

Re: Auto-set Skype availability to Busy when phone is locked?
 
Quote:

Originally Posted by shallimus (Post 581023)
My question is: is there a way to cause the N900 to set my Availability to 'Busy' or some other status when the phone locks?

You can try with this:
If you tap on the clock - it will appear menu with "Availability" setting, from which you can see your Skype status. Set to "Busy", or "Not available".
I think this relates on your Skype/Google Talk status. It do not related to your call status - you can still receive/call.
Hope this helps you.
Regards.

jacktanner 2010-03-25 05:15

Re: Auto-set Skype availability to Busy when phone is locked?
 
I believe the OP is asking for an automatic away/busy setting, not a manual one. Great idea! Time for a brainstorm?

lasseaagren 2010-03-25 09:29

Re: Auto-set Skype availability to Busy when phone is locked?
 
I've toyed with the idea of autoaway myself and have so far created this little python "daemon"

(This Work in progess, I take no resposibility to what might happen to your device. Use it at your own cost and peril)

PHP Code:

#!/usr/bin/python
import threading
import dbus
gobject
import gtk
from dbus
.mainloop.glib import DBusGMainLoop
import telepathy
.constants

awaydelay
=5
xmppaccount
="/org/freedesktop/Telepathy/Account/gabble/jabber/****_40gmail_2ecom0"

def timer_callback():
   print 
"screen has been off for defined number of  seconds"
   
sessionbus dbus.SessionBus()   
   
gmailobj sessionbus.get_object('org.freedesktop.Telepathy.AccountManager'xmppaccount)
   
gmailinterface=dbus.Interface(gmailobj'org.freedesktop.DBus.Properties')
   
gmailstruct=dbus.Struct((dbus.UInt32(telepathy.constants.CONNECTION_PRESENCE_TYPE_AWAY), '''autoaway'))
   
gmailinterface.Set('org.freedesktop.Telepathy.Account''RequestedPresence'gmailstruct)

screentimer threading.Timer(awaydelaytimer_callback)

def screen_callback(value):
   print 
"screen is:"value
   
if value == "off":
      
screentimer.__init__(awaydelaytimer_callback)
      
screentimer.start()
   if 
value == "on":
      
screentimer.cancel()

#Main loop
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

bus dbus.SystemBus()

bus.add_signal_receiver(screen_callback,
                        
dbus_interface="com.nokia.mce.signal",
                        
signal_name="display_status_ind")

gtk.gdk.threads_init()

loop gobject.MainLoop()
loop.run() 

It listens on the DBUS for status of the screen. When the screen has been off for "awaydelay" seconds, it sets (again through DBUS) "xmppaccount" away. It doesn't bring the account back online when the screen is turned on again in the current state.

If you would like to test it out:

1) Save the contents of the above to a file e.g. called n900autoaway.py on your device, install one ekstra package called python-telepathy (which is required).

2) Edit the "awaydelay" and "xmmpaccount" to suit you. A list of conversation DBUS names for you Conversation accounts can be obtained through:

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
3) Once edited you start it from the terminal with:

python n900autoaway.py.

Take it as it is. Maybe I'll improve it, maeybe I won't. Make suggestions, make improvements, make whatever :-)

Best regards,
Lasse

PS: btw I have no idea if this works with skype accounts so this may be off topic :)

shallimus 2010-03-29 14:36

Re: Auto-set Skype availability to Busy when phone is locked?
 
Thanks all, particularly lasseaagren. This looks very interesting and while I don't know Python, it seems easy enough to read.

I would love to say that I'll give this a go this evening, but unfortunately I have just broken the screen of my N900 - argh. What's worse: I live in Canada where Nokia "do not sell that model", and so apparently I will have to send my phone to the US for repair and I will need a US address for the purpose.

Look forward to giving this a try... eventually :rolleyes:

nbc 2010-03-29 15:46

Re: Auto-set Skype availability to Busy when phone is locked?
 
Quote:

Originally Posted by TomJ (Post 581220)
I don't think there's an obvious way. It may be something that's acheivable using dbus scripts? Might be worth asking in this thread.

Yes, that's doable with dbus-scripts.

You can modify the script here : http://wiki.maemo.org/DbusScripts#wh..._on_noisy_ring

The dbus-scripts configuration will be :

Code:

  /usr/bin/logit.sh * * com.nokia.mce.signal tklock_mode_ind *
The last arg will be locked or unlocked.


All times are GMT. The time now is 07:48.

vBulletin® Version 3.8.8