[prev in list] [next in list] [prev in thread] [next in thread] 

List:       irssi-users
Subject:    determining user focus
From:       Frederik Dohr <fdg001 () gmx ! net>
Date:       2011-02-15 11:43:56
Message-ID: 4D5A66FC.5050601 () gmx ! net
[Download RAW message or body]

Is there a simple way for a script to determine user focus (basically,
whether the Irssi window is active in the foreground)?

I understand this is tricky because Irssi is terminal-based and thus
doesn't care about window management, so I created a GTK wrapper for the
containing terminal window[1] - but that seems like a terribly
over-engineered workaround.

Essentially, all I want is to change the terminal title (as poor man's
persistent notification[2]) when a certain message is received (e.g. on
hilight), then reset the title  when the user (un)focuses the terminal
window. The former is easy[3], but for the latter I'm stumped.

If no such focus event/signal exists, can anyone think of a sensible
workaround (e.g. binding Enter to trigger the reset[4])?

Any pointers would be greatly appreciated!


-- F.


[1] https://gist.github.com/822511 (at least it was educational for me)
[2] Growl-style notifications (e.g. notify-send) don't persist - I've
    also explored (ab)using the terminal bell, to no avail.
[3] sig_printtext: parse, then print "\033]0;$title\007" to STDERR
[4] I've tried `/bind return multi <...>`, but only managed to disable
    the send_line trigger in the process...



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic