Skip to content

goropikari/Notifier.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notifier

Build Status Build status codecov.io

This package is no longer maintained.

This package is notification tools for Julialang.

using Notifier
notify("Task completed")

Screenshot of a Notification

Features:

  • Linux and macOS
    • popup notification (desktop notification)
    • sound notification
    • say notification (Read a given message aloud)
    • email notification
    • count up and count down timer
  • Windows (Experimental)
    • popup notification (desktop notification)
    • sound notification
    • say notification (Read a given message aloud)
    • count up and count down timer

Installation

using Pkg
Pkg.add("Notifier")

Setup for Linux user

Before using Notifier.jl, you need to install following softwares in your Linux system.

  • libnotify for a desktop notification
  • mail for an e-mail notification
  • aplay (Advanced Linux Sound Architecture) for a sound notification
  • espeak for reading a given message aloud
$ sudo apt install libnotify-bin alsa-utils espeak mailutils heirloom-mailx bsd-mailx

This package uses mail command to notify by e-mail. You may need some settings in advance. If following command works correctly, you don't need further setting.

$ echo test | mail -s foo yourmail@example.com

Usage

popup notification

using Notifier
notify("Task completed")
# defalut title is "Julia".
# You can change the title by title option.
notify("Task completed", title="foofoo")
notify("Task completed", sound=true) # with sound
notify("Task completed", sound="foo.wav") # Specify a sound file (for Linux and Windows)

Linux
Screenshot of a Notification

macOS
Screenshot of a Notification

Windows
Screenshot of a Notification

sound and say notification

alarm() # only sound. You can specify a sound file, alarm(sound="foo.wav")
say("Finish calculation!") # Read aloud

e-mail notification

email("message", To="foo@example.com") # default subject is set by date.
email("message", subject="result", To="foo@example.com")

If you use email function frequently, I recommend you to register your email address by register_email function.

julia> register_email()
Type your desired recipient e-mail address to receive a notification.
e-mail: foo@example.com

Recipient e-mail address is saved at /path/to/.julia/v0.6/Notifier/email/address.txt.
If you want to change the address, modify /path/to/.julia/v0.6/Notifier/email/address.txt directly or run register_email() again

After you registered, you don't need to specify e-mail address.

email("message")

Timer

When the specified time limit has been reached, notify by sound.

h,m,s = 1,2,3
countup(h,m,s) # Hour, Minute, Second
countdown(h,m,s)

Acknowledgement

Inspired by OSXNotifier.jl.