You are not logged in.
Hello fellow archers,
with noteo seemingly dead and all other available notification daemons being
more or less tightly coupled to a window manager, I thought it would be cool
to have a (hopefully) worthy successor.
Introducing notipy:
As its github page states, notipy is an implementation of the
Desktop Notification Specification. It shows message popups using gtk3, allowing
for pango marked up message bodies and icons that can be specified in various
ways.
For more information, please refer to the github page. I hope some people will
find it helpful. Any comments, feature requests or bug reports should go either
to this thread or directly to github.
Kind greetings!
Last edited by the_isz (2011-05-31 08:04:24)
Offline
Very cool, I like it. One minor issue though:
$ notipy.py -a NORTH_WEST
usage: notipy.py [-h] [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
[-t EXPIRETIMEOUT] [-m MARGINS]
[-a {NORTH_WEST,SOUTH_WEST,SOUTH_EAST,NORTH_EAST}]
[-d {VERTICAL,HORIZONTAL}]
notipy.py: error: argument -a/--layout-anchor: invalid choice: 0 (choose from 'NORTH_WEST', 'SOUTH_WEST', 'SOUTH_EAST', 'NORTH_EAST')
Same issue with -d. Also, I think you have your east and west mixed up.
Offline
Just stumbled upon a more significant error with claws-mail (with the notification plugin):
$ notipy.py -l DEBUG
DEBUG:root:summary: "New Mail message", body: "test"
DEBUG:root:Notification ID: 1
DEBUG:root:type of icon: <type 'dbus.Struct'>
ERROR:root:Exception occured during window creation.
Traceback (most recent call last):
File "/usr/bin/notipy.py", line 428, in Notify
win = self.__create_win(summary, body, image)
File "/usr/bin/notipy.py", line 242, in __create_win
bytearray(icon[7]), GdkPixbuf.Colorspace.RGB, icon[3], icon[4],
IndexError: tuple index out of range
Claws-mail and claws-mail-extra-plugins are both version 3.7.9-3, notipy 0.1-1. Notify-send works fine, including specifying the icon as either a name (eg. important) or path. Let me know if you need any more info.
EDIT: Solved, the image data is in index 6, not 7 (zero based indexing strikes again!). PS: thanks for your impressive commenting in the code.
Last edited by quigybo (2011-05-31 20:00:09)
Offline
Very cool, I like it. One minor issue though:
$ notipy.py -a NORTH_WEST usage: notipy.py [-h] [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-t EXPIRETIMEOUT] [-m MARGINS] [-a {NORTH_WEST,SOUTH_WEST,SOUTH_EAST,NORTH_EAST}] [-d {VERTICAL,HORIZONTAL}] notipy.py: error: argument -a/--layout-anchor: invalid choice: 0 (choose from 'NORTH_WEST', 'SOUTH_WEST', 'SOUTH_EAST', 'NORTH_EAST')
Same issue with -d. Also, I think you have your east and west mixed up.
Thanks for the hints. Wonder why that didn't occur to me during testing, but I
can definitely reproduce it. Will fix it soon, tomorrow, if not today.
Also thanks for the compliment about the comments. I'm trying to code up to what
my software-engineering professor used to hammer into our heads:
"THE CODE IS NOT YOURS! So write code that is readable by others, too."
Lastly, I just noted that the notipy package should probably provide
notification-daemon. I will add that to the PKGBUILD for the next version.
Offline
Alright, version 0.1.1 is out and fixes the bugs with the command-line argument
parsing reported by quigybo. Also, the embarrassing mix-up of east and west is
now corrected.
Offline
Good stuff, the option parsing and east/west positioning are working well, thanks. To clarify what I meant in my second post:
diff --git a/code/notipy.py b/code/notipy.py
index 3fdf18c..2e75ed7 100755
--- a/code/notipy.py
+++ b/code/notipy.py
@@ -239,7 +239,7 @@ class NotificationDaemon(dbus.service.Object):
# rowstride, destroy_fn, destroy_fn_data
# FIXME: Do I need to free the image via a function callback?
pixbuf = GdkPixbuf.Pixbuf.new_from_data(
- bytearray(icon[7]), GdkPixbuf.Colorspace.RGB, icon[3], icon[4],
+ bytearray(icon[6]), GdkPixbuf.Colorspace.RGB, icon[3], icon[4],
icon[0], icon[1], icon[2], lambda x, y: None, None)
iconWidget = Gtk.Image()
Offline
Good stuff, the option parsing and east/west positioning are working well, thanks. To clarify what I meant in my second post:
diff --git a/code/notipy.py b/code/notipy.py index 3fdf18c..2e75ed7 100755 --- a/code/notipy.py +++ b/code/notipy.py @@ -239,7 +239,7 @@ class NotificationDaemon(dbus.service.Object): # rowstride, destroy_fn, destroy_fn_data # FIXME: Do I need to free the image via a function callback? pixbuf = GdkPixbuf.Pixbuf.new_from_data( - bytearray(icon[7]), GdkPixbuf.Colorspace.RGB, icon[3], icon[4], + bytearray(icon[6]), GdkPixbuf.Colorspace.RGB, icon[3], icon[4], icon[0], icon[1], icon[2], lambda x, y: None, None) iconWidget = Gtk.Image()
I don't know whether I'm getting you right. Do you think this is a bug in notipy?
Offline
I don't know whether I'm getting you right. Do you think this is a bug in notipy?
Yes, an error occurs when an application sends the icon as <type 'dbus.Struct'>. The image data is in index 6 in the struct, not 7 (it is the seventh item, but the struct is zero-indexed).
Offline
Yes, an error occurs when an application sends the icon as <type 'dbus.Struct'>. The image data is in index 6 in the struct, not 7 (it is the seventh item, but the struct is zero-indexed).
OK, just released version 0.1.2 fixing the bug you mentioned (thanks for that!)
and now expanding ~ characters in icon path names.
Offline