![]() |
2010-03-24
, 23:57
|
|
Posts: 505 |
Thanked: 665 times |
Joined on Oct 2009
|
#2
|
The Following User Says Thank You to TomJ For This Useful Post: | ||
![]() |
2010-03-25
, 05:08
|
Posts: 229 |
Thanked: 36 times |
Joined on Jan 2010
@ Bulgaria
|
#3
|
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?
![]() |
2010-03-25
, 05:15
|
Posts: 228 |
Thanked: 145 times |
Joined on Dec 2009
|
#4
|
![]() |
2010-03-25
, 09:29
|
Posts: 11 |
Thanked: 31 times |
Joined on Nov 2008
@ Denmark
|
#5
|
#!/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(awaydelay, timer_callback)
def screen_callback(value):
print "screen is:", value
if value == "off":
screentimer.__init__(awaydelay, timer_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()
/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
![]() |
2010-03-29
, 14:36
|
|
Posts: 568 |
Thanked: 969 times |
Joined on Dec 2009
@ Toronto
|
#6
|
![]() |
2010-03-29
, 15:46
|
Posts: 36 |
Thanked: 42 times |
Joined on Jan 2010
|
#7
|
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.
/usr/bin/logit.sh * * com.nokia.mce.signal tklock_mode_ind *
The Following User Says Thank You to nbc For This Useful Post: | ||
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]