diff options
author | Mantas Mikulėnas <grawity@gmail.com> | 2015-01-14 07:38:22 +0200 |
---|---|---|
committer | Mantas Mikulėnas <grawity@gmail.com> | 2015-01-14 11:41:33 +0200 |
commit | 083c9c410a48973d5a91a44a5af5bf2b21dd2a8f (patch) | |
tree | 57b70f6650c2b4c1fd2383f9c8724ee3aeabf7cd | |
parent | 9722769d804bda569b9c9ffcc2827ed942e9b694 (diff) |
ignore specific app names
-rwxr-xr-x | dzenify | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -15,6 +15,13 @@ try: except ImportError: from gi.repository import GLib as glib +## <Configuration> +# (TODO: use ConfigParser) + +IGNORED_APP_NAMES = { + # example: "foo", "bar", "baz" +} + DZEN_ARGS = [ "dzen2", "-l", "1", @@ -22,11 +29,12 @@ DZEN_ARGS = [ "-ta", "c", "-bg", "#222222", "-fg", "#EEEEEE", - #"-fn", "terminus", ] BG_URGENT = "#6e2222" +## </Configuration> + NF_SERVICE = "org.freedesktop.Notifications" NF_OBJECT = "/org/freedesktop/Notifications" NF_INTERFACE = "org.freedesktop.Notifications" @@ -98,10 +106,15 @@ class DzenifyService(dbus.service.Object): @dbus.service.method(NF_INTERFACE, in_signature="susssasa{sv}i", out_signature="u") def Notify(self, app_name, id, icon, summary, body, actions, hints, timeout): - trace("got hints:", hints) + trace("Notify(%r, ...)" % app_name) + + if app_name in IGNORED_APP_NAMES: + return id # process hints + trace("got hints:", hints) + urgency = int(hints.get("urgency", 1)) raw_summary = bool(hints.get("dzen-summary-markup", False)) raw_body = bool(hints.get("dzen-body-markup", False)) |