You are not logged in.

#1 2010-08-11 21:52:02

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

irssi, perl and the notification script

I've been testing this perl script to get notifications using notify-send under irssi:

notify.pl

The problem is, this script sends a notification when irssi window is either active or inactive. I find it useless to notify me when I'm typing a message, as I can see if I get new messages, so I'd like it to notify only if the irssi window is inactive (example, using Chromium, so I don't see irssi).

I've tried asking the coder who did this code, but he said that he doesn't know the way to find out if the window is active or inactive, since irssi runs in a terminal.

Any ideas appreciated. smile

Offline

#2 2010-08-13 18:51:41

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

Re: irssi, perl and the notification script

I think it's nearly impossible to do that. The script has to check if the terminal irssi is running in is the active X window.
I don't know of a way to get the title/id of the window irssi is running in, from within the script. And then you still need a way to get the title/id of the focused window.

And what's with the scenario, that you see the whole window but it's not active. That would involve way too much work.

If you're using urxvt you could also set the 'URxvt.urgentOnBell' resource and change the script to simply ring the bell. The window manager should then highlight the window if it's not active. But this works only for the first notification.

Offline

#3 2010-08-13 20:04:46

archman-cro
Member
From: Croatia
Registered: 2010-04-04
Posts: 943
Website

Re: irssi, perl and the notification script

This is interesting, I will look into it later. Thanks!
Edit: Aaah, yes, only for the first notification. Nice tip, anyway. Cheers!

Last edited by archman-cro (2010-08-13 20:44:13)

Offline

Board footer

Powered by FluxBB