You are not logged in.

#1 2013-02-23 07:27:10

yoanar
Member
Registered: 2012-06-10
Posts: 24

Critical DBus notification in AwesomeWM using Python, having trouble.

I can easily get Awesome to display the DBus notifications, but the problem is that i can't seem to make it a "critical" notification. Is this even possible with Awesome, when you're using an external program/script?

Here's the code.

import dbus as db
bus_name = 'org.freedesktop.Notifications'
object_path = '/org/freedesktop/Notifications'

def notifyDBus(app_name = 'event_handler', expire = 5000, body = '', title = '', replaces = 0, icon = '', actions = [], hints = []):
    try:
        bus = db.SessionBus()
        obj = bus.get_object(bus_name, object_path)
        interface = db.Interface(obj, bus_name)
        interface.Notify(app_name, replaces, icon, title, body, actions, hints, int( expire ))
        return 0
    except:
        return 1

notifyDBus(title = 'CRASH REPORT', body = "event_handler.py has crashed!\nCheck \"bat.log\" for more info.", icon = image_crash, hints = {'urgency': 2}, replaces = 2)

Isn't the {'urgency': 2} part supposed to set "args.preset" to "naughty.config.presets.critical," effectively making it red and setting expire to 0?

Or is there something simple I'm missing?


Meh.

Offline

Board footer

Powered by FluxBB