<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>ronin: Command line Gnome Notification</title>
    <link>http://blogs.divisibleprime.com/ronin/articles/2008/03/10/command-line-gnome-notification</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Stuff</description>
    <item>
      <title>Command line Gnome Notification</title>
      <description>&lt;p&gt;From the &amp;#8220;it&amp;#8217;s almost certainly been done better somewhere else&amp;#8221; department, here is my script to fire off a Gnome Notification after a shell command finishes.&lt;/p&gt;

&lt;p&gt;a python script:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/usr/bin/python
from pynotify import *
import sys

def notify(message=""):
    n = Notification("Command Line Completed", message)
    n.show()

init("cli notify")
if len(sys.argv) &amp;gt; 1:
    notify(sys.argv[1])
else:
    notify()
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then just add it to your path and you can append it onto some command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;echo monkey &amp;amp;&amp;amp; mynotify.py "some message"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You then get a notification like so:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://blogs.divisibleprime.com/ronin/files/notify.png" alt="image"/&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 10 Mar 2008 21:38:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:d238e5be-6172-45f2-85db-d6d2eebbeb42</guid>
      <author>Kerry</author>
      <link>http://blogs.divisibleprime.com/ronin/articles/2008/03/10/command-line-gnome-notification</link>
      <category>Tech</category>
      <category>Gnome</category>
      <category>Linux</category>
      <category>linux</category>
      <category>gnomy</category>
      <category>python</category>
      <category>notify</category>
      <category>desktop</category>
      <trackback:ping>http://blogs.divisibleprime.com/ronin/articles/trackback/940</trackback:ping>
    </item>
    <item>
      <title>"Command line Gnome Notification" by gollo</title>
      <description>&lt;p&gt;Nice one, have been looking for something simple like this for ages.  How about making a sound optionally as well?&lt;/p&gt;</description>
      <pubDate>Wed, 12 Mar 2008 15:41:09 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:132c41c8-6646-4c60-aeaf-877286933b88</guid>
      <link>http://blogs.divisibleprime.com/ronin/articles/2008/03/10/command-line-gnome-notification#comment-53</link>
    </item>
  </channel>
</rss>
