Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: UTF8 -*-
- import gobject
- import gtk
- import appindicator
- import pynotify
- import sys
- import time
- import threading
- import os
- ico1 = "img/02.png"
- ico2 = "img/03.png"
- def menuitem_response(w, optionName):
- print "menu response:", optionName
- def quitApplication(w, optionName):
- sys.exit(0)
- def sauce():
- ind = appindicator.Indicator("example-simple-client",
- ico1, #"indicator-messages",
- appindicator.CATEGORY_APPLICATION_STATUS)
- ind.set_status(appindicator.STATUS_ACTIVE)
- ind.set_attention_icon(ico2)
- menu = gtk.Menu()
- ind.set_menu(menu)
- return ind
- """
- # create a menu (ca marche mais c'est pas ce que je veux)
- menu = gtk.Menu()
- # create some drop down options
- optionName = "Menu Option"
- menu_items = gtk.MenuItem(optionName)
- menu.append(menu_items)
- menu_items.connect("activate", menuitem_response, optionName)
- menu_items.show()
- optionName = "Menu Option 2"
- menu_items = gtk.MenuItem(optionName)
- menu.append(menu_items)
- menu_items.connect("activate", menuitem_response, optionName)
- menu_items.show()
- optionName = "Quit"
- menu_items = gtk.MenuItem(optionName)
- menu.append(menu_items)
- menu_items.connect("activate", quitApplication, optionName)
- menu_items.show()
- ind.set_menu(menu)
- return ind
- """
- def thr():
- pass
- def thr2():
- print 0. # eh ouais.. j'en suis la =)
- time.sleep(3)
- print 1.
- ind.set_status(appindicator.STATUS_ATTENTION)
- time.sleep(4)
- print 2.
- ind.set_status(appindicator.STATUS_ACTIVE)
- time.sleep(2)
- print 3.
- # raw_input("::")
- # print 4.
- #gtk.main_quit()
- #os.kill(pid, 9)
- """ osd notif: ok
- pynotify.init('wallch_indicator')
- n = pynotify.Notification('ah que coucou', 'meuh', 'notification-message-im')
- n.show()
- time.sleep(4)
- print 5.
- """
- exit(0)
- gobject.threads_init()
- ind = sauce()
- t = threading.Thread(target=thr2)
- t.start()
- gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement