User Guide

Introduction

Nowadays, pretty much everyone has a smartphone, and this is what they use to keep in touch with the world.  However, most people still use a desktop PC – especially at work – as well, so how do you keep in touch with the world when you’re at your desk?

Sure, you can still get notified on your phone (or even smartwatch), but what happens if you’ve got no signal, your not-so-smart watch has gone flat, or you’re in a secret nuclear bunker and you’ve had to leave your phone outside?

Snarl breaks this down into a simple statement:

when stuff_happens()
  {
    tell_me();
  }

When stuff_happens()

In Snarl terms, something happening is known as an event.  Applications must register with Snarl so they’re authorised to generate notifications.  When an application registers, it also adds one or more events which are used as a basis for creating notifications.  Let’s take a hypothetical Instant Messaging client as an example, which might register the following events:

public void PhatIM()
{
    Snarl snarl = register_with_snarl();
    snarl.add_event("contact_signs_in");
    snarl.add_event("contact_signs_out");
    snarl.add_event("instant_message_received");
    snarl.add_event("someone_added_you");
}

When one of these events occurs, the application should use the appropriate registered event to display the notification.

Snarl gives you control over how each event is handled so, the more events an application registers, the more granular the control you have over what the application notifies you about.

And don’t let the word “application” throw you: an application here can be anything that does something, so don’t be surprised to see Instagram, Tumblr or even the weather on Mars wanting to send you notifications…

tell_me()

When an event occurs, you can be notified using an on-screen display (usually referred to simply as a Display) and/or one or more Redirects.

Displays are the most obvious (and therefore most common) way to be notified.  Snarl displays the notification content on-screen, typically in a small rectangular-shaped bubble – although many other variations are possible – and will play a sound effect if you’ve told it to.   The bubble will disappear immediately if it’s clicked on, or after a short amount of time if not.

An on-screen display notification

Snarl’s API is highly extensible, so applications can include extra functionality along with the notification which certain styles will recognise.  This includes, but is certainly not limited to: percentage values (which are typically displayed as a meter), a pre-formatted date or time value, additional information about a music track, and so on.

The Clock display showing the time and date from a specially formatted notification.

Applications can also include a selection of options to pick from.  These are then displayed in a pop-up menu which opens when the user clicks on the appropriate gadget, as follows:

While seeing a notification on-screen is important, having the ability to receive the notification when you’re not at your computer can be invaluable.  This is where redirects come in.  As the name suggests, a redirect takes the notification content and sends it to an external destination.  This could be a phone (as a text message), smart phone (as an email or other form of message such as an IM) or literally any other device.  For example, the notification could be:

  • Spoken through your computer’s speakers
  • Sent on as an email
  • Displayed as a notification on a smartphone
  • Posted to a social media site
  • Routed to an attached Braille or other accessibility device
  • Logged as a Windows Event
  • Displayed on an external visual device such as a scrolling LED banner

The notification content can also be forwarded directly to another computer, or passed as an argument to another application – so the possibilities really are only limited by your imagination…