#!/usr/bin/python

import sys
from PyQt4 import QtCore
from PyQt4 import QtGui


class SystemTrayIcon(QtGui.QSystemTrayIcon):
    def __init__(self, parent=None):
        QtGui.QSystemTrayIcon.__init__(self, parent)

        self.setIcon(QtGui.QIcon("/usr/share/icons/gnome/32x32/actions/stock_search.png"))

        self.iconMenu = QtGui.QMenu(parent)
        appexit = self.iconMenu.addAction("Exit")
        self.setContextMenu(self.iconMenu)

        self.connect(appexit, QtCore.SIGNAL('triggered()'), self.appExit)

        self.show()


    def appExit(self):
        sys.exit()

app = QtGui.QApplication(sys.argv)

trayIcon = SystemTrayIcon()
trayIcon.show()

sys.exit(app.exec_())
