From 1e172db041c1db42ac8884446dfa344a5816daf5 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Tue, 12 Feb 2013 19:23:37 -0500 Subject: [PATCH] add xmpp_notify.py, tweak weechat_notify.py --- weechat_notify.py | 3 +-- xmpp_notify.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 xmpp_notify.py diff --git a/weechat_notify.py b/weechat_notify.py index c0bbc4e..8b85049 100755 --- a/weechat_notify.py +++ b/weechat_notify.py @@ -13,7 +13,7 @@ import yaml from gi.repository import Notify -Notify.init("Weechat Notifications") +Notify.init("weechat") config = yaml.safe_load(open(os.path.expanduser('~/.config/weechat/config.yaml'))) connection = pika.BlockingConnection(pika.connection.URLParameters( @@ -33,7 +33,6 @@ def handle_notify(ch, method, properties, body): channel=data[':channel']), data[':message'], 'dialog-information') n.show() - #print(data) channel.basic_consume(handle_notify, queue=queue_name, no_ack=True) channel.start_consuming() diff --git a/xmpp_notify.py b/xmpp_notify.py new file mode 100755 index 0000000..0e986b0 --- /dev/null +++ b/xmpp_notify.py @@ -0,0 +1,19 @@ +#!/usr/bin/python3 +################################################################################ +# xmpp_notify.py - xmpp-client notifications with libnotify +# +# author: mutantmonkey +################################################################################ + +import sys +from gi.repository import Notify + + +Notify.init("xmpp-client") + +if len(sys.argv) > 0: + msg = "new message: " + sys.argv[1] +else: + msg = "new message" +n = Notify.Notification.new("xmpp-client", msg, 'dialog-information') +n.show() -- 2.51.2