Gnome notifications from your Terminal!

Its pretty easy to get your terminal to notify you using Gnome’s libnotify system and a short python script. Python’s pynotify package (available as Debian/Ubuntu package: python-notify) I use this short script occasionally to notify me when a long compile is done like this:

[code lang=”bash”] make && echo "Done compiling!" | notifier [/code]

Short python script in my $PATH called “notifier”

[code lang=”python”]
#!/usr/bin/python
import pynotify
import sys

pynotify.init("Quick Notify")
input = sys.stdin.readline()
msg = pynotify.Notification("Shell Notification:", input)
msg.show()
[/code]

This entry was posted in Random, Ubuntu. Bookmark the permalink.

3 Responses to Gnome notifications from your Terminal!

  1. kase says:

    how can add a textbox?!

  2. Yuri says:

    Nice! Thanks a lot!

  3. Kamal Nasser says:

    Thank you very much!

Leave a Reply

Your email address will not be published. Required fields are marked *