import gtk
import gobject

image_nb = 0

def set_image():
	image = gtk.Image()
	global image_nb
	if image_nb == 0:
		image.set_from_file('online.png')
		image_nb = 1
	else:
		image.set_from_file('away.png')
		image_nb = 0
	status_icon.set_from_pixbuf(image.get_pixbuf())
	return True

status_icon = gtk.StatusIcon()
status_icon.set_tooltip('tooltip')
status_icon.set_visible(True)
gobject.timeout_add(1000, set_image)
gtk.main()
