You are here: Home Personal My Blog Shell Gnome Notification Applet

Shell Gnome Notification Applet

by Harald Hoyer last modified Oct 09, 2009 11:09 AM
This article shows how to create a small notification applet in shell script with the help of zenity.

Because my internet connection is very flaky at the moment, I needed to know, if my internet connection is still up. Because my DSL modem is a  Speedport W 503V, which does not run Linux on it, I had to query the connection status in another way. Luckily it has a web interface, which shows the internet status without the need to log in. So I wrote a little shell script which "parses" the html page. In fact the parsing doesn't have to be very sophisticated, it's just a simple grep. Then I found out about zenity, which provides a nice shell interface to create a visual representation on the desktop.  

 

 

 The trick is, to open zenity with an extra file descriptor in "--listen" mode. So you can change the state of the notification dynamically. Here is the simple shell script. Maybe you can tweak it for your needs.

Filed under: