Пример #1
0
    def Notify(self, app_name, notification_id, app_icon, summary, body,
               actions, hints, expire_timeout):
        msg = Msg()
        # find id.
        self._id += 1
        msg.application = str(app_name)
        msg.notid = notification_id
        msg.mid = self._id
        msg.summary = str(summary)
        msg.body = str(body)
        if int(expire_timeout) > 0:
            msg.deadline = time.time() + int(expire_timeout) / 1000.0
        if 'urgency' in hints:
            msg.urgency = int(hints['urgency'])
        self._rofication.add_notification(msg)

        os.system('awesome-client \'naughty=require("naughty"); ' +
                  'naughty.notify({title="%s",text="%s (%s)"})\'' %
                  (msg.summary, msg.body, msg.application))

        cmd = ''
        cmd += 'local naughty = require("naughty");'
        cmd += 'naughty.notify({'
        cmd + + '  title = "%s (%s)",' % (msg.summary, msg.application)
        cmd += '  text  = "%s",' % (msg.body)
        cmd += '})'

        os.system('awesome-client \'%s\'' % cmd)
        return notification_id
Пример #2
0
 def Notify(self, app_name, notification_id, app_icon, summary, body,
            actions, hints, expire_timeout):
     msg = Msg()
     # find id.
     self._id += 1
     msg.application = str(app_name)
     msg.notid = notification_id
     msg.mid = self._id
     msg.summary = str(summary)
     msg.body = str(body)
     if int(expire_timeout) > 0:
         msg.deadline = time.time() + int(expire_timeout) / 1000.0
     if 'urgency' in hints:
         msg.urgency = int(hints['urgency'])
     self._rofication.add_notification(msg)
     return notification_id
Пример #3
0
 def Notify(self, app_name, notification_id, app_icon,
            summary, body, actions, hints, expire_timeout):
     msg = Msg()
     # find id.
     self._id += 1
     msg.application  = str(app_name)
     msg.notid        = notification_id
     msg.mid          = self._id
     msg.summary      = str(summary)
     msg.body         = str(body)
     if int(expire_timeout) > 0:
         msg.deadline = time.time()+int(expire_timeout) / 1000.0
     if 'urgency' in hints:
         msg.urgency  = int(hints['urgency'])
     self._rofication.add_notification( msg )
     return notification_id