Hexchat notifications on alternate ALSA devices
July the 12th, 2024
As pointed out on Another post, I've a peculiar system with more than one sound card.
I use HexChat for IRC (a fork of the XChat project, almost dead by now) and I used to have sound notifications when anybody would type my name on a channel. HexChat uses Gtk2 and I don't use Gnome as my DE, hence I can't set a specific sound card for notifications; it can use libcanberra, but the problem persists.
Since HexChat has a Python builtin module for plugins I coded a custom plugin for it.
It allows you to set a custom sound file for nick notifications, and, most important, it allows you to set which ALSA device use for them. At this moment it can use hardware devices only, but I'm planning to support also "virtual" devices too, usually set using files like ~/.asoundrc
or /etc/asound.conf
.
The only requirement is pyalsaaudio, which you might already have if you are some sort of audio nerd like I am ;)..
You can download the script from my GitHub repository: hexchat-alsa-notify.