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:

 make && echo "Done compiling\!" | notifier 

Short python script in my $PATH called “notifier”

#!/usr/bin/python
import pynotify
import sys

pynotify.init("Quick Notify")
input = sys.stdin.readline()
msg = pynotify.Notification("Shell Notification:", input)
msg.show()
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!