Created
September 3, 2014 11:26
-
-
Save mohammad7t/f1229131fd6a93f42021 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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