Too Cool for Internet Explorer

libnotify over ssh

libnotify-over-ssh

libnotify is a nice desktop notification framework, very similar to Growl. It’s basically a client-server architecture: the desktop implements a notification-daemon where the clients send notifications to (via D-Bus).

In my case it’s notification-daemon-xfce and on the client side primarily galarm and pidgin (using a patched pidgin-libnotify plugin).

With notify-send you can also create your own notification. I wrote a little zsh wrapper function to get a notification when the command terminates:

# run some command and notify about the result via the notification-daemon
function run () {
$@
local error=$?
if [[ $error -eq 0 ]]; then
notify-send “`hostname -s` | terminated:” “$1 $2″ -i finish -t 0
else
notify-send “`hostname -s` | aborted:” “$1 $2″ -u critical -i undo -t 0
fi
return $error
}

The usage is quite simple:
# run sudo update-eix

All of this is nice but I decided to need notification of remote events as well.
I hate to wait or poll till a command on my server terminates, instead the server should notify me. ;)
Additionally I run a WeeChat IRC-client 24/7 in screen and want a notification for (private) IRC messages.

Accomplishing my requirements is a tough task, but after some research I found this nice idea of Jared Quinn: libnotify-with-irssi-over-ssh.
The trick is to tunnel the notification through the terminal using the print pipe.

I adapted his scripts and patched them to fit my needs:

My favorite terminal is rxvt-unicode so the .Xdefaults entry looks a bit different:
URxvt.print-pipe: ~/scripts/unmarshal.pl
My unmarshal script collects the content of the pipe and sends the notification to the daemon:
unmarshal.pl (html)libnotify-small.png

…the WeeChat plugin (based on growl-notify):

remote-notification.pl (html)

…and finally the drop-in replacement for notify-send:

notify-send (html)

If notify-send is placed in /usr/local/bin/ on the remote host, you can just type something like run sudo updatedb and get a notification to the desk. 8-)

Blurminal

blurminal

blurminal.jpg

Just tripped over this nice Terminal.app (10.5) plugin (via SIMBL) which does nothing else but blur the background of your windows, to let you have transparency in a way that doesn’t confuse you :)

Grab your copy here - thanks Ciarán!

Powered by WordPress with GimpStyle Theme design by Horacio Bella. Get Entries and comments.