|
| 1 | +=head1 NAME |
| 2 | + |
| 3 | +B<rgrowl> -- Send and receive Growl notifications from remote machines. |
| 4 | + |
| 5 | +=head1 SYNOPSIS |
| 6 | + |
| 7 | +rgrowl [-hsw] [--amazon-access-key key] [--amazon-region region] |
| 8 | +[--amazon-secret-key key] [-a appname] [-d identifier] [-H host] [-i extension] |
| 9 | +[-I filepath] [--image filepath] [-m message] [-n name] [-P password] |
| 10 | +[-p priority] [--sqs-queue queuename] [-t] [title] |
| 11 | + |
| 12 | +rgrowl --daemon [--amazon-access-key key] [--amazon-region region] |
| 13 | +[--amazon-secret-key key] [--poll-interval interval] [--sqs-queue queuename] |
| 14 | + |
| 15 | +rgrowl --man |
| 16 | + |
| 17 | +Options: |
| 18 | + |
| 19 | + --amazon-access-key Your AWS Access Key ID. |
| 20 | + --amazon-region The AWS region in which to store the notifications. |
| 21 | + --amazon-secret-key Your AWS Secret Key. |
| 22 | + --appIcon,-a The application to use for the icon. |
| 23 | + --daemon Run in receiving rather than sending mode. |
| 24 | + --help,-h Display a short help message. |
| 25 | + --host,-H The hostname or IP for a remote Growl notification. |
| 26 | + --icon,-i The filetype or extension to take the icon from. |
| 27 | + --iconpath,-I A file whose icon should be the notification icon. |
| 28 | + --identifier,-d An identifier to help coalesce notifications. |
| 29 | + --image An image to use as the icon for the notification. |
| 30 | + --man Display a man page for rgrowl. |
| 31 | + --message,-m The text of the notification. |
| 32 | + --name,-n The name of the app sending the notification. |
| 33 | + --password,-P The password to authenticate a remote notification. |
| 34 | + --poll-interval The time to sleep between polling in daemon mode. |
| 35 | + --priority,-p Set the urgency of the notification. |
| 36 | + --sqs-queue The name of the SQS queue used for storage. |
| 37 | + --sticky,-s Require the notification to be dismissed manually. |
| 38 | + --title,-t Here for compatibility with growlnotify. |
| 39 | + --wait,-w Ignored. Here for compatibility with growlnotify. |
| 40 | + |
| 41 | +=head1 DESCRIPTION |
| 42 | + |
| 43 | +L<Growl|http://growl.info/> natively has the ability to receive and display |
| 44 | +notifications but it requires Growl to be reachable by the remote sender. On |
| 45 | +many networks your machine may be behind a firewall or NAT which makes it |
| 46 | +difficult to reach. |
| 47 | + |
| 48 | +B<rgrowl> uses L<Amazon SQS|http://aws.amazon.com/sqs/> as a "mailbox" for Growl |
| 49 | +notifications. Any app wishing to send a growl notification simply runs |
| 50 | +B<rgrowl> with the same arguments as Growl's L<growlnotify> command line |
| 51 | +program. On the receiving machine, B<rgrowl> runs as a daemon and polls the |
| 52 | +SQS mailbox for notifications and displays them as appropriate. As soon as the |
| 53 | +message is received, it is deleted from the mailbox. |
| 54 | + |
| 55 | +To set B<rgrowl> up, see the instructions in L</INSTALLATION> below. |
| 56 | + |
| 57 | +The following options are available: |
| 58 | + |
| 59 | +=over 21 |
| 60 | + |
| 61 | +=item B<--amazon-access-key> |
| 62 | + |
| 63 | +The Access Key ID for your Amazon Web Services account. |
| 64 | + |
| 65 | +=item B<--amazon-region> |
| 66 | + |
| 67 | +The region where you wish to keep your SQS queue. By default, it's kept in |
| 68 | +us-east-1 but you may wish to change this to a region closer to you. |
| 69 | + |
| 70 | +=item B<--amazon-secret-key> |
| 71 | + |
| 72 | +The Secret Key matching your Access Key ID above. |
| 73 | + |
| 74 | +=item B<--appIcon>, B<-a> |
| 75 | + |
| 76 | +Either the name of an application or the full path to the .app directory for |
| 77 | +that application. The icon for this application will be used as the icon for |
| 78 | +the notification I<or> as part of the icon for the notification depending on |
| 79 | +the values of B<--icon>, B<--iconpath>, B<--image> and the Growl display style |
| 80 | +used. |
| 81 | + |
| 82 | +=item B<--daemon> |
| 83 | + |
| 84 | +Run B<rgrowl> in the background collecting and triggering Growl notifications. |
| 85 | +You should never need to specify this manually, if you've installed B<rgrowl> |
| 86 | +according to the instructions below it should be set up automatically for you. |
| 87 | + |
| 88 | +=item B<--help>, B<-h> |
| 89 | + |
| 90 | +Display a short summary of the available command line options. |
| 91 | + |
| 92 | +=item B<--host>, B<-H> |
| 93 | + |
| 94 | +The host to send the Growl notification to. Note, this is not required unless |
| 95 | +you've installed the B<rgrowl> daemon in order to relay the notifications to |
| 96 | +another machine. |
| 97 | + |
| 98 | +=item B<--icon>, B<-i> |
| 99 | + |
| 100 | +Provide a file extension and the icon for the notification will be the icon for |
| 101 | +that file type. |
| 102 | + |
| 103 | +=item B<--iconpath>, B<-I> |
| 104 | + |
| 105 | +Provide a path to a file and the appropriate icon for that file will be used as |
| 106 | +the icon for the notification. |
| 107 | + |
| 108 | +=item B<--identifier>, B<-d> |
| 109 | + |
| 110 | +If several notifications are sent with the same identifier the notifications |
| 111 | +will be coalesced into one on display. Only some displays support coalescing. |
| 112 | + |
| 113 | +=item B<--image> |
| 114 | + |
| 115 | +Use this to specify the image to be used as the icon for the notification. |
| 116 | + |
| 117 | +=item B<--man> |
| 118 | + |
| 119 | +Display a man page for B<rgrowl>. |
| 120 | + |
| 121 | +=item B<--message>, B<-m> |
| 122 | + |
| 123 | +The message portion of the notification. |
| 124 | + |
| 125 | +=item B<--name>, B<-n> |
| 126 | + |
| 127 | +Set the name of the application which is sending the notification. |
| 128 | + |
| 129 | +=item B<--password>, B<-P> |
| 130 | + |
| 131 | +Provide a password for notifications sent to remote hosts. Ignored unless |
| 132 | +B<--host> is used. |
| 133 | + |
| 134 | +=item B<--poll-interval> |
| 135 | + |
| 136 | +Set the amount of time (in seconds) to sleep between polling for new messages. |
| 137 | +The lower you make this, the more "instant" the notifications you feel. On the |
| 138 | +other hand, it will cost you more money in AWS fees. |
| 139 | + |
| 140 | +=item B<--priority>, B<-p> |
| 141 | + |
| 142 | +Set the priority of the notification. Valid values are: |
| 143 | + |
| 144 | +=over |
| 145 | + |
| 146 | +=item Very Low |
| 147 | + |
| 148 | +=item Moderate |
| 149 | + |
| 150 | +=item Normal |
| 151 | + |
| 152 | +=item High |
| 153 | + |
| 154 | +=item Emergency |
| 155 | + |
| 156 | +=item -2 |
| 157 | + |
| 158 | +=item -1 |
| 159 | + |
| 160 | +=item 0 |
| 161 | + |
| 162 | +=item 1 |
| 163 | + |
| 164 | +=item 2 |
| 165 | + |
| 166 | +=back |
| 167 | + |
| 168 | +Not all display methods respect priority. |
| 169 | + |
| 170 | +=item B<--sqs-queue> |
| 171 | + |
| 172 | +The name of the SQS queue in which to store the notifications while they're in |
| 173 | +transit. |
| 174 | + |
| 175 | +=item B<--sticky>, B<-s> |
| 176 | + |
| 177 | +Make the notification sticky, i.e. require user interaction to dismiss the |
| 178 | +notification. |
| 179 | + |
| 180 | +=item B<--title>, B<-t> |
| 181 | + |
| 182 | +Set the title of the notification. If this is not provided, the remaining |
| 183 | +non-option command line arguments are used as the title. If both this option |
| 184 | +and extra items are used, the extra arguments are concatenated onto this |
| 185 | +argument. |
| 186 | + |
| 187 | +=item B<--wait>, B<-w> |
| 188 | + |
| 189 | +Wait until the notification has been dismissed before returning. Due to the way |
| 190 | +B<rgrowl> is constructed this is not possible so this argument is ignored. |
| 191 | + |
| 192 | +=back |
| 193 | + |
| 194 | +=head1 INSTALLATION |
| 195 | + |
| 196 | +Before installing rgrowl, you should sign up for Amazon Web Services. Then log |
| 197 | +into the AWS Console and create an SQS queue called "GrowlNotifications". |
| 198 | + |
| 199 | +=head2 On all machines using rgrowl |
| 200 | + |
| 201 | +=over |
| 202 | + |
| 203 | +=item 1. Install rgrowl's dependencies |
| 204 | + |
| 205 | +In addition to L<Getopt::Long> and L<Pod::Usage>, rgrowl also requires |
| 206 | +L<Amazon::SQS::Simple> and L<JSON>. If your chosen operating system does not |
| 207 | +already have a package for these modules you can install them using CPAN with |
| 208 | +the following two commands: |
| 209 | + |
| 210 | +=over 2 |
| 211 | + |
| 212 | +=item $ |
| 213 | + |
| 214 | +sudo perl -MCPAN install Amazon::SQS::Simple |
| 215 | + |
| 216 | +=item $ |
| 217 | + |
| 218 | +sudo perl -MCPAN install JSON |
| 219 | + |
| 220 | +=back |
| 221 | + |
| 222 | +=item 2. Install rgrowl |
| 223 | + |
| 224 | +Copy rgrowl to a directory in your path and make it executable. For example, to |
| 225 | +install it system-wide run the following: |
| 226 | + |
| 227 | +=over 2 |
| 228 | + |
| 229 | +=item $ |
| 230 | + |
| 231 | +sudo cp rgrowl /usr/bin/rgrowl |
| 232 | + |
| 233 | +=item $ |
| 234 | + |
| 235 | +sudo chmod 555 /usr/bin/rgrowl |
| 236 | + |
| 237 | +=back |
| 238 | + |
| 239 | +=item 3. Configure rgrowl |
| 240 | + |
| 241 | +Create a configuration file with the following contents: |
| 242 | + |
| 243 | + amazon-access-key = 'AAAAAAAAAAAAAAAAAAAA' |
| 244 | + amazon-secret-key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' |
| 245 | + amazon-region = 'us-east-1' |
| 246 | + |
| 247 | +Replace the values with the appropriate ones found in your Amazon Web Services |
| 248 | +Console. Any command line option is allowed (minus the -- prefix) but the above |
| 249 | +is the recommended minimum. |
| 250 | + |
| 251 | +Install the configuration file in any one of the following locations (this is |
| 252 | +the order in which configuration files are searched for, later files override |
| 253 | +earlier ones). |
| 254 | + |
| 255 | +=over |
| 256 | + |
| 257 | +=item /opt/local/etc/rgrowlrc |
| 258 | + |
| 259 | +=item /usr/local/etc/rgrowlrc |
| 260 | + |
| 261 | +=item /etc/rgrowlrc |
| 262 | + |
| 263 | +=item $HOME/.rgrowlrc |
| 264 | + |
| 265 | +=back |
| 266 | + |
| 267 | +=back |
| 268 | + |
| 269 | +=head2 On the machine displaying Growl notifications |
| 270 | + |
| 271 | +On the machine where you want your Growl notifications to display, you need to |
| 272 | +do the following additional steps. |
| 273 | + |
| 274 | +=over |
| 275 | + |
| 276 | +=item 1. Install Growl |
| 277 | + |
| 278 | +If you haven't done it already, install Growl. |
| 279 | + |
| 280 | +=item 2. Install growlnotify |
| 281 | + |
| 282 | +If you are running a version of Growl earlier than version 1.3, growlnotify is |
| 283 | +available inside the DMG file you downloaded. For Growl 1.3 and later you need |
| 284 | +to download it separately from L<http://growl.info/extras.php#growlnotify>. |
| 285 | + |
| 286 | +=item 3. Arrange for rgrowl to be run in daemon mode. |
| 287 | + |
| 288 | +Run the following commands in a terminal: |
| 289 | + |
| 290 | + $ launchctl submit -l com.mcdermottroe.rgrowl -- \ |
| 291 | + /usr/bin/perl -T /usr/bin/rgrowl --daemon |
| 292 | + $ launchctl start com.mcdermottroe.rgrowl |
| 293 | + |
| 294 | +=back |
| 295 | + |
| 296 | +=head1 DIAGNOSTICS |
| 297 | + |
| 298 | +The B<rgrowl> utility exits 0 on success, and >0 if an error occurs. |
| 299 | + |
| 300 | +=head1 ENVIRONMENT |
| 301 | + |
| 302 | +The following environment variables affect the execution of B<rgrowl>: |
| 303 | + |
| 304 | +=over 6 |
| 305 | + |
| 306 | +=item PATH |
| 307 | + |
| 308 | +The PATH is used to search for L<growlnotify(1)> and L<osascript(1)>. The |
| 309 | +former is required and the latter is desirable when running in daemon mode. |
| 310 | + |
| 311 | +=back |
| 312 | + |
| 313 | +=head1 LICENSE |
| 314 | + |
| 315 | +Copyright (c) 2012, Conor McDermottroe |
| 316 | +All rights reserved. |
| 317 | + |
| 318 | +Redistribution and use in source and binary forms, with or without |
| 319 | +modification, are permitted provided that the following conditions are met: |
| 320 | + |
| 321 | +=over 2 |
| 322 | + |
| 323 | +=item - |
| 324 | + |
| 325 | +Redistributions of source code must retain the above copyright notice, this |
| 326 | +list of conditions and the following disclaimer. |
| 327 | + |
| 328 | +=item - |
| 329 | + |
| 330 | +Redistributions in binary form must reproduce the above copyright notice, this |
| 331 | +list of conditions and the following disclaimer in the documentation and/or |
| 332 | +other materials provided with the distribution. |
| 333 | + |
| 334 | +=back |
| 335 | + |
| 336 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 337 | +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 338 | +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 339 | +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 340 | +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 341 | +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 342 | +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 343 | +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 344 | +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 345 | +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 346 | + |
| 347 | +=cut |
| 348 | + |
| 349 | +=head1 SEE ALSO |
| 350 | + |
| 351 | +L<growlnotify(1)> |
0 commit comments