A Little GUI for Your CLI
I've tried pretty much every IRC client available for both Linux and OS X. (I use both platforms during my day job.) No matter how many times I try to find a GUI application that meets my needs, I always turn back to Irssi. It works so well, and I can access it from anywhere (Figure 1). Thanks to my Raspberry Pi colocation in Austria, I always can stay logged in and never miss a message. Unfortunately, the one thing I wish Irssi had is a pop-up notification when someone sends me a message or mentions me in a channel. So, I decided to give Irssi a little GUI. It was fun, and as it turns out, it works very well.
Figure 1. I actually had to scroll up a bit to find something harmless enough to post in the magazine!
If you're running Irssi locally on the Linux machine you're sitting in front of, this process is much simpler. Since my Irssi-connected machine is on another continent, the process is a little more complex, but also a lot more fun. In order to get local GUI notifications for remote mentions of my user name, I need to accomplish a few things:
I have to get Irssi to generate some sort of event and/or log when I'm mentioned in an IRC channel or query.
I have to parse that information and transfer it to my local machine over the Internet in real time.
I need to display a GUI pop-up on my local machine when the remote events occur, again in real time.
I need to be able to disconnect and reconnect to a screen session and have the GUI notifications follow me, regardless of what computer I'm actually on. (In my case, this means Linux or OS X.)
Thankfully, Linux supplies all the tools I need, and with a little bit of scripting, I can get the system working.
Step 1: Irssi Events
I'm obviously not the first person to want a GUI notification system for Irssi, and thankfully, Thorsten Leemhuis has shared his Irssi plugin for everyone to use. You can download the plugin at http://www.leemhuis.info/files/fnotify/fnotify, and since it's released under the GPL, you can share it as you see fit.
In order to use the script, save it as fnotify.pl in your ~/.irssi/scripts/ folder where Irssi is running. For me, that's on my remote server in Austria. Once saved, you can load the script by typing:
/script load fnotify.pl
from inside the Irssi application. If you want to make fnotify.pl be loaded automatically every time Irssi starts (my recommendation), create a symbolic link into the autorun folder inside the scripts folder. To do that, type:
mkdir ~/.irssi/scripts/autorun (if it doesn't exist already) ln -s ~/.irssi/scripts/fnotify.pl ↪~/.irssi/scripts/autorun/fnotify.pl
Then fnotify should be loaded every time Irssi starts. To make sure it's working correctly, have someone mention you in an IRC channel, and check to see that the message is written to the file ~/.irssi/fnotify.
Once you're certain the plugin is working, and mentions of your name are written to the fnotify file, it's time to get that information to your local computer. But first, you need to set up the local computer for GUI pop-up messages, so you have somewhere to send the information when you transfer it.
A Local GUI Notification
This part of the equation is fairly simple. Most Linux distributions come
with a notification system of some sort. I prefer a GNOME environment,
so I choose to use libnotify, or more specifically the
command that creates a GUI pop-up when invoked from the command line
or from a script. KDE users can use the
kdialog program for a similar
effect, and OS X users will want to check out Terminal Notifier, hosted
From your Linux command line, test
notify-send by typing:
notify-send "Test Title" "Sample message..."
That should bring up a libnotify box with your title and message (Figure 2). If you're using KDE (or OS X), the command will be similar, but you'll need to check for the exact syntax. It's also possible to tweak the program to get custom icons, change the duration of the pop-up and even change the system urgency for the notification. I actually use a Pidgin icon for the notification box, only because I've used Pidgin for so long, the icon makes me think chat.
Figure 2. The pop-up system is really pretty slick.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Sony Settles in Linux Battle
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Libarchive Security Flaw Discovered
- Profiles and RC Files
- Maru OS Brings Debian to Your Phone
- Understanding Ceph and Its Place in the Market
- Snappy Moves to New Platforms
- Git 2.9 Released
- The Giant Zero, Part 0.x
- Astronomy for KDE
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide