If you look back at my scripts I guess it kinda seems like I have a fetish for creating scripts that sends highlights and PMs to certain devices using certain methods. So why not another one? This one, however, doesn't send it to your Android and/or iPhone, it displays it as a Growl Notification on your Desktop computer, currently I've only tested it with Growl 1.3 on OS X Lion. However, technically, there shouldn't be any problem running it on let's say windows, or earlier versions of Growl(Don't quote me on that).
Okay, sadly you can't just load the script and expect everything to work, there's some stuff you, or your server admin needs to sort out first, OR if you run irssi locally, you need to sort out. First, there's a couple of packages that needs to be installed. I use Debian GNU/Linux on my server, so sadly I don't know what they are called on other dists, but you'll probably be able to figure it out by some googling. Run the following command if you use Debian GNU/Linux(note that build-essential is Debian specific, basically, just be sure you have make installed on your system, you'll need it later):
$ apt-get update;apt-get install libcrypt-cbc-perl libdata-uuid-perl build-essential
Now you should have 2 out of 3 required packages installed, the last one needs to be installed using cpan, because it wasn't available as a package in the Debians reps, not that I found at least, the module in question is Growl::GNTP. And this is the reason you need make, which I pointed out earlier, because cpan uses make. Run the following command:
$ cpan -i Growl::GNTP
Now all the packages are installed, so things should be jolly good on the dependency side. But! Growl on your computer needs to be able to receive connections, so you need to go to
Now you should be all set! Once you've loaded the script, use this command to set the ip
/set growl_host 1.2.3.4
where 1.2.3.4 is the IP-address of the computer running growl which probably is your own computer. If you're using a dynamic IP and are NOT running irssi locally(then it's just 127.0.0.1) you might want to consider using dyndns or similar service. Next up is to set the password you defined earlier, you can do that by typing
/set growl_password passwd
where passwd is the password you set in Growl preferences. Now everything should work fine! and it should look something like this:

This script is nothing fancy, it's based off my earlier once, as you might notice. Basically all it does it to send your PMs and highlights to your desktop, so you don't miss anything and can feed your IRC addiction no matter what workspace you're on! As always, you can download the script here and the source can, as always, be found below.
1. use strict; 2. use warnings; 3. 4. ##################################################################### 5. # This script sends notifications to growl on your 6. # computer when you're highlighted/PMed using Growl GNTP 7. # 8. # 9. # 10. # Commands: 11. # /set growl_password growl_password 12. # /set growl_general_hilight on/off 13. # /set growl_priority_channel -2 up to 2 14. # /set growl_priority_pm -2 up to 2 15. # /set growl_priority_general -2 up to 2 16. # /set growl_host COMPUTER HOST/IP 17. # /set growl_port Port for Growl, use default value. 18. # /set growl_icon_url http URL for notification icon. 19. # 20. # "General hilight" basically referrs to ALL the hilights you have 21. # added manually in irssi, if many, it can get really bloated if 22. # turned on. Default is Off. 23. # 24. # You will need the following packages: 25. # Growl::GNTP (You can install this using cpan -i Growl::GNTP) 26. # 27. # You will also need to following packages, which can be installed 28. # in Debian using the following command: 29. # apt-get update;apt-get install libcrypt-cbc-perl libdata-uuid-perl 30. # 31. # You will need to configure Growl to be able to receive 32. # notifications. 33. # 34. # 35. # eth0 will prevail. || irc.eth0.info 36. # 37. ##################################################################### 38. 39. 40. use Irssi; 41. use Irssi::Irc; 42. use vars qw($VERSION %IRSSI); 43. use Growl::GNTP; 44. use Encode; 45. 46. $VERSION = "0.1"; 47. 48. %IRSSI = ( 49. authors => "Caesar 'sniker' Ahlenhed", 50. contact => "sniker\@se.linux.org", 51. name => "irssigrowl", 52. description => "Sends growlnotifcations to your computer", 53. license => "GPLv2", 54. url => "http://sniker.codebase.nu", 55. changed => "Mon Oct 3 23:23:32 CET 2011", 56. ); 57. 58. # Configuration settings and default values. 59. Irssi::settings_add_str("growl", "growl_password", ""); 60. Irssi::settings_add_bool("growl", "growl_general_hilight", 0); 61. Irssi::settings_add_str("growl", "growl_priority_channel", 0); 62. Irssi::settings_add_str("growl", "growl_priority_pm", 0); 63. Irssi::settings_add_str("growl", "growl_priority_general", 0); 64. Irssi::settings_add_str("growl", "growl_host", "localhost"); 65. Irssi::settings_add_str("growl", "growl_port", 23053); 66. Irssi::settings_add_str("growl", "growl_icon_url", "http://sniker.codebase.nu/files/irc.png"); 67. 68. sub send_noti { 69. my ($event, $text, $priority) = @_; 70. 71. 72. my $growl = Growl::GNTP->new( 73. PeerHost => Irssi::settings_get_str("growl_host"), 74. PeerPort => Irssi::settings_get_str("growl_port"), 75. AppName => "Irssi", 76. Password => Irssi::settings_get_str("growl_password"), 77. PasswordHashAlgorithm => "MD5"); 78. 79. $growl->register([ 80. { Name => "Irssi", }, 81. { Enabled => "True", }, 82. { Priority => $priority, },]); 83. 84. $growl->notify( 85. Event => "Irssi", 86. Title => "Irssi - " . $event, 87. Message => $text, 88. Icon => Irssi::settings_get_str("growl_icon_url"), 89. Priority => $priority); 90. } 91. 92. sub pubmsg { 93. my ($server, $data, $nick) = @_; 94. 95. if($data =~ /$server->{nick}/i){ 96. send_noti("Hilighted", $nick . ': ' . $data, Irssi::settings_get_str("growl_priority_channel")); 97. } 98. } 99. 100. sub privmsg { 101. my ($server, $data, $nick) = @_; 102. send_noti("PM", $nick . ': ' . $data, Irssi::settings_get_str("growl_priority_pm")); 103. } 104. 105. sub genhilight { 106. my($dest, $text, $stripped) = @_; 107. my $server = $dest->{server}; 108. 109. if($dest->{level} & MSGLEVEL_HILIGHT) { 110. if(Irssi::settings_get_bool("growl_general_hilight")){ 111. send_noti("General Hilight", $stripped, Irssi::settings_get_str("growl_priority_general")); 112. } 113. } 114. } 115. 116. Irssi::signal_add_last('message public', 'pubmsg'); 117. Irssi::signal_add_last('message private', 'privmsg'); 118. Irssi::signal_add_last('print text', 'genhilight'); 119.
I assume anyone reading this know how to install a script, if not, ask a friend, because if you don't, you're sure as hell gonna need more help than just installing the script. Any questions? Comments below.
sniker[at]codebase[dot]nu
Updated Tue, 04 Oct 2011 01:55:24 +0200