# 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
if __name__ == '__main__':
+ if len(sys.argv) != 2:
+ sys.stderr.write("Usage: %s <message>\n" % (sys.argv[0]))
+ sys.exit(1)
+
# Display configuration.
BOLD = True
FG_COLOR = 'blue'
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)