Skip to content

A toolbox in Java to send notifications (Growl, Snarl, Notification Center, notify-send, etc)

License

Notifications You must be signed in to change notification settings

jcgay/send-notification

Repository files navigation

send-notification

A toolbox in Java to send notifications.

Usage

Add dependency with your favorite build tool.

Example with Maven:

    <dependencies>
     [...]
        <dependency>
            <groupId>fr.jcgay.send-notification</groupId>
            <artifactId>send-notification</artifactId>
            <version>0.16.0</version>
        </dependency>
     [...]
    </dependencies>

Get a notifier:

    Notifier notifier = new SendNotification()
        .setApplication(application)
        .initNotifier();

The application is not mandatory, you'll get a default one if it's not set.

Then send notification:

    try {
        notifier.send(notification);
    } finally {
        notifier.close;
    }

CLI

Download bundle, extract it, add the bin directory to your $PATH. For OS X users, you can use a brew formula here.

> send-notification -h

Usage: <main class> [options] notifier(s)
  Options:
    -h, --help
       show help
       Default: false
  * -i, --icon
       notification icon
    -l, --level
       notification level (INFO, WARNING, ERROR)
  * -m, --message
       notification message
    -s, --subtitle
       notification subtitle
  * -t, --title
       notification title
    -v, --version
       show version
       Default: false

(*) are mandatory parameters.

Example:

send-notification notifysend -m "Build success !" -t "maven-notifier" -i "success.png"

Available notifiers

Go to Wiki to read full configuration guide for each notifier.

Notifier Screenshot
Growl, for Windows and OS X. Growl
Snarl, for Windows Snarl
terminal-notifier, OS X terminal-notifier
notification center OS X (since Mavericks) notification-center
notify-send for Linux notify-send
SystemTray since Java 6 System Tray
Pushbullet pushbullet
Kdialog for KDE Kdialog
notifu for Windows notifu
AnyBar for OS X and Linux anybar
Toaster for Windows 8 toaster
Notify since Java 6 Notify
BurntToast for Windows 10 (NB must be enabled manually) BurntToast
Slack Slack

Build status

Build Status Coverage Status Quality Gate

Build

You will need Maven and a JDK 8. If your default JDK is higher than 8, Maven will use a configured toolchains.

mvn verify

Multiple VMs are available in vm for Windows, Linux and macOS to integrate with the various notifiers.

Release

mvn -B release:prepare release:perform

About

A toolbox in Java to send notifications (Growl, Snarl, Notification Center, notify-send, etc)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •