fnotify.pl | ||
msg_notification.mp3 | ||
README.md |
irssi-scripts
FNotify - Desktop and Voice Notifications for Irssi
FNotify is a Perl script for the Irssi IRC client that provides real-time desktop notifications for private messages and channel highlights. It helps you stay aware of important IRC activity even when your terminal is not in focus.
The script is designed to be robust and "theme-proof," meaning it works reliably even if you use a custom Irssi theme that modifies the appearance of messages. It also includes an optional, configurable voice alert feature using the Festival Speech Synthesis System.
Features
- Desktop Notifications: Get instant pop-up notifications via
notify-send
when you receive a private message or when your nick is mentioned in a channel. - Voice Alerts (Optional): Enable spoken notifications through Festival for.. hands-free awareness?
- Theme-Proof: Uses a two-signal method to reliably detect highlights, making it compatible with custom Irssi themes.
- Configurable: Easily enable or disable voice alerts on-the-fly from within Irssi without needing to edit the script.
- Lightweight: The script is simple and efficient, with no external Perl library dependencies.
Prerequisites
Before using fnotify.pl
, you must have the following software installed on your system:
-
notify-send
: A command-line tool for sending desktop notifications.- On Debian, install with:
sudo apt-get install libnotify-bin
- On Debian, install with:
-
Festival (Optional): Required only if you want to use the voice alert feature.
- On Debian, install with:
sudo apt-get install festival
- You may also want a higher-quality voice pack, such as
festvox-us-slt-hts
.
- On Debian, install with:
Installation
-
Place the Script: Download or save the
fnotify.pl
script into your Irssi scripts directory.mkdir -p ~/.irssi/scripts/ # Now, place fnotify.pl inside ~/.irssi/scripts/
-
Load the Script: Inside Irssi, load the script with the following command:
/script load fnotify.pl
-
Automatic Loading (Recommended): To ensure the script loads every time you start Irssi, create a symbolic link to it in your
autorun
directory.cd ~/.irssi/scripts/autorun/ ln -s ../fnotify.pl .
If the
autorun
directory does not exist, create it first:mkdir -p ~/.irssi/scripts/autorun
.
Configuration
You can control the script's features directly from the Irssi command prompt.
Enabling/Disabling Voice Alerts
-
To enable voice alerts:
/set festival_enabled ON
-
To disable voice alerts (default):
/set festival_enabled OFF
-
To check the current setting:
/set festival_enabled
Customizing the Festival Voice
If you have multiple Festival voices installed, you can choose which one the script uses by editing the fnotify.pl
file directly.
- Open
~/.irssi/scripts/fnotify.pl
in a text editor. - Find the following line near the top of the script:
my $festival_voice = '(voice_us1_mbrola)';
- Change the value to the name of your preferred voice. You can find available voices by running
festival
and entering the command(voice.list)
.
How It Works (Technical Detail)
We use a two-signal approach to maintain compatibility with custom themes:
- The
message public
signal is used first to capture the raw, unformatted message content and the sender's nickname before any theme can audaciously modify them. - The
print text
signal, which fires immediately after, is then used only to check if Irssi has flagged the message as a highlight. - If it is a highlight, the script uses the clean, raw data captured in the first step to build the notification, completely ignoring the themed text.
This decoupling ensures that notifications are always reliable, regardless of your visual setup in Irssi.
License
This script is released into the Public Domain. You are free to use, modify, and distribute it as you see fit.