Skip to content

Instantly share code, notes, and snippets.

@mohammad7t
Created September 3, 2014 11:26
Show Gist options
  • Save mohammad7t/f1229131fd6a93f42021 to your computer and use it in GitHub Desktop.
Save mohammad7t/f1229131fd6a93f42021 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
#*-* coding: utf-8 *-*
import dbus
bus = dbus.SessionBus()
obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
def set_message(message):
# Get current status type (Available/Away/etc.)
current = purple.PurpleSavedstatusGetType(purple.PurpleSavedstatusGetCurrent())
# Create new transient status and activate it
status = purple.PurpleSavedstatusNew("", current)
purple.PurpleSavedstatusSetMessage(status, message)
purple.PurpleSavedstatusActivate(status)
import time
i=0
while True:
i = i+1 if i<20 else 0
set_message(u''.join([u' ']*i + [u'آقای هنرمند، بستنی آواتار جدید رو دادی ؟']))
time.sleep(0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment