X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=bin%2Fnotify.py;h=3caa7d2a70ede6e931d5b535dc3c02f6bce00405;hb=4dbbb218433fae75837e3f7daa7ba3313ae54533;hp=68c331a86483ec8144592fd73a81ec6e6407bc79;hpb=e03c647317bd1861e4e84f59089bc5ebca44e739;p=config%2Fdotfiles.git diff --git a/bin/notify.py b/bin/notify.py index 68c331a..3caa7d2 100755 --- a/bin/notify.py +++ b/bin/notify.py @@ -3,7 +3,7 @@ # notify.py is a simple notification program displaying a message on the # screen. -# Copyright (C) 2011-2012 Simon Ruderich +# Copyright (C) 2011-2013 Simon Ruderich # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,6 +35,10 @@ def mouse_press_callback(widget, event): if __name__ == '__main__': + if len(sys.argv) != 2: + sys.stderr.write("Usage: %s \n" % (sys.argv[0])) + sys.exit(1) + # Display configuration. BOLD = True FG_COLOR = 'blue' @@ -44,7 +48,8 @@ if __name__ == '__main__': window = gtk.Window(gtk.WINDOW_POPUP) # No window border or close/resize buttons. window.set_decorated(False) - # In case set_decorated(False) doesn't work with the used window manager. + # In case set_decorated(False) doesn't work with the used window manager + # quit when the window is manually closed. window.connect('delete-event', gtk.main_quit) # Enable mouse click events, by default windows don't receive them. window.add_events(gtk.gdk.BUTTON_PRESS_MASK)