From 2653dabd2f5bc06703105287f0ed8f0aacda6289 Mon Sep 17 00:00:00 2001 From: goropikari Date: Sun, 4 Mar 2018 10:08:45 +0900 Subject: [PATCH 1/5] add say and change the style of popup notification --- README.md | 4 ++-- docs/winpopup.png | Bin 3100 -> 14424 bytes src/mac.jl | 2 +- src/three-balls.ico | Bin 0 -> 41662 bytes src/windows.jl | 34 ++++++++++++++++++++++++++++++---- test/windows_test.jl | 6 ++++++ 6 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 src/three-balls.ico diff --git a/README.md b/README.md index 3de9562..b4ade23 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # Notifier -[![Notifier](http://pkg.julialang.org/badges/Notifier_0.6.svg)](http://pkg.julialang.org/detail/Notifier) [![Build Status](https://travis-ci.org/goropikari/Notifier.jl.svg?branch=master)](https://travis-ci.org/goropikari/Notifier.jl) [![codecov.io](http://codecov.io/github/goropikari/Notifier.jl/coverage.svg?branch=master)](http://codecov.io/github/goropikari/Notifier.jl?branch=master) @@ -20,10 +19,11 @@ notify("Task completed") - desktop notification - sound notification - email notification - - say notification (Read given massage aloud) + - say notification (Read a given massage aloud) - Windows (Experimental) - desktop notification - sound notification + - say notification (Read a given massage aloud) ## Installation ```Julia diff --git a/docs/winpopup.png b/docs/winpopup.png index 2c43597f36ee2c0c69439c88a28e1b28091f3007..7ec44df5ca3367f7d074f4964ec772a28334bcd4 100644 GIT binary patch literal 14424 zcmV-eIH$*nP)WFU8GbZ8()Nlj2>E@cM*03ZNKL_t(|+U=croLxn= z@4r>G_c=Xxr@NERJdlu(goGI-2#SId0^ES_f+&JA`w;P7XD=u`FBcKz$`zj=g99pq zqM`x96J(Y#$QUG$5JE`ENYb6|KIiORRqv0gz0c5d(h-O3&u4#&tXc4?|z$KTu`VsBijU7Bjw zu@g0wwHd52V7Eaw%Y@FA#Bt1C@gG@y{q>N0{jb`nfvlv&1`tAQmtB?oj>Ik-;(Z3& zzMZZhD&Awr{a0ZGN$VCaBMc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l^ z99K@3z&|y|NeH@48CtM!umPM9r%$3F(;@eOXIL!xaepV6X$+lrylV7;qaOu z;Xk5V}kSSRoqV59COdF(HIohlajO7dmbh_oyRw%5RZHA8*r3Gt!1_1ka3o}M+a$OOM9GJp6j6v+37 zz)fhMmJ%y%1_WXX1E0+N-16&5U3~(9XGQeek%K(=FE(2T!xD0R^;4;8vfXe`v0WJev Y21dvLK*IlU1ULd50geDiKpO)82R~6SIRF3v literal 0 HcmV?d00001 diff --git a/src/windows.jl b/src/windows.jl index 1a57761..47e0571 100644 --- a/src/windows.jl +++ b/src/windows.jl @@ -1,5 +1,5 @@ import Base.notify -export notify, alarm +export notify, alarm, say """ --- Notifier.notify(message; title="Julia", sound=false, time=4) @@ -14,7 +14,7 @@ Notify by desktop notification. function notify(message::AbstractString; title="Julia", sound::Union{Bool, AbstractString}=false, - time::Real=4) + time::Real=8) if sound == true || typeof(sound) <: AbstractString if sound == true @async run(`powershell -Command '('new-object System.Media.SoundPlayer $(joinpath(@__DIR__, "default.wav"))')'.PlaySync'('')'`) @@ -22,9 +22,23 @@ function notify(message::AbstractString; @async run(`powershell -Command '('new-object System.Media.SoundPlayer $sound')'.PlaySync'('')'`) end end - @async run(pipeline(`powershell '('new-object -comobject wscript.shell')'.popup'(''"'$message'"', $time,'"'$title'"',0')'`, stdout=DevNull, stderr=DevNull)) + #@async run(pipeline(`powershell '('new-object -comobject wscript.shell')'.popup'(''"'$message'"', $time,'"'$title'"',0')'`, stdout=DevNull, stderr=DevNull)) - return + # ref. Create a balloon notification in PowerShell / IT Pro + # http://www.itprotoday.com/management-mobility/create-balloon-notification-powershell + @async run(`powershell '['Void']''['System.Reflection.Assembly']'':'':'LoadWithPartialName'(''"'System.Windows.Forms'"'')'';' + \$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon';' + \$objNotifyIcon.BalloonTipIcon = '"'Info'"'';' + \$objNotifyIcon.Icon = '"'$(joinpath(@__DIR__, "three-balls.ico"))'"'';' + \$objNotifyIcon.BalloonTipText = '"'$message'"'';' + \$objNotifyIcon.BalloonTipTitle = '"'$title'"'';' + \$objNotifyIcon.Visible = \$True';' + \$objNotifyIcon.ShowBalloonTip'('$(time*1000)')'';' + Start-Sleep -s $time';' + \$objNotifyIcon.dispose'('')' + `) + + return nothing end """ @@ -39,3 +53,15 @@ alarm(sound="foo.wav") function alarm(;sound::AbstractString=joinpath(@__DIR__, "default.wav")) @async run(`powershell -Command '('new-object System.Media.SoundPlayer $sound')'.PlaySync'('')'`) end + +""" + Notifier.say(message::AbstractString) + +Read a given message aloud. +""" +function say(message::AbstractString) + @async run(`powershell Add-Type -AssemblyName System.speech';' + \$s = New-Object System.Speech.Synthesis.SpeechSynthesizer';' + \$s.Speak'(' '"' $message '"' ')' + `) +end diff --git a/test/windows_test.jl b/test/windows_test.jl index e69699d..e579ed3 100644 --- a/test/windows_test.jl +++ b/test/windows_test.jl @@ -28,3 +28,9 @@ end catch false end +@test try + say("Hello world") + true +catch + false +end From f4efc4be0bd9f754aa649999eb4781f4f33fc924 Mon Sep 17 00:00:00 2001 From: goropikari Date: Sun, 4 Mar 2018 11:11:49 +0900 Subject: [PATCH 2/5] add say --- .travis.yml | 1 + README.md | 88 +++++++++------------------------------------- src/linux.jl | 11 +++++- test/linux_test.jl | 6 ++++ 4 files changed, 33 insertions(+), 73 deletions(-) diff --git a/.travis.yml b/.travis.yml index 853eed9..cfbf1de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ addons: packages: - libnotify-bin - alsa-utils + - espeak script: - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi - julia -e 'Pkg.clone(pwd()); Pkg.build("Notifier"); Pkg.test("Notifier"; coverage=true)' diff --git a/README.md b/README.md index b4ade23..a68fa1f 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,11 @@ notify("Task completed") ![Screenshot of a Notification](./docs/linuxpopup.png?raw=true) ## Features: - - Linux + - Linux and macOS - desktop notification - sound notification - - email notification - - macOS - - desktop notification - - sound notification - - email notification - say notification (Read a given massage aloud) + - email notification - Windows (Experimental) - desktop notification - sound notification @@ -30,18 +26,18 @@ notify("Task completed") Pkg.add("Notifier") ``` -# Linux OS -## Setup +## 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 massage aloud ```bash -$ sudo apt install libnotify-bin alsa-utils mailutils heirloom-mailx bsd-mailx +$ sudo apt install libnotify-bin alsa-utils espeak mailutils heirloom-mailx bsd-mailx ``` -This package uses `mail` command to notify by e-mail. Thus you need some settings in advance. +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. ```bash $ echo test | mail -s foo yourmail@example.com @@ -56,64 +52,23 @@ notify("Task completed") # 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 -alarm() # only sound. You can specify a sound file, alarm(sound="foo.wav") +notify("Task completed", sound="foo.wav") # Specify a sound file (for Linux and Windows) ``` +Linux ![Screenshot of a Notification](./docs/linuxpopup.png?raw=true) -### e-mail notification -```Julia -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 -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. -```Julia -email("message") -``` +macOS +![Screenshot of a Notification](./docs/macpopup.png?raw=true) +Windows +![Screenshot of a Notification](./docs/winpopup.png?raw=true) -# macOS -## Usage -### popup notification +### sound and say notification ```julia -using Notifier -notify("Task completed") -notify("Change title", title="foofoo") -notify("Notification with sound", sound=true) alarm() # only sound. You can specify a sound file, alarm(sound="foo.wav") say("Finish calculation!") # Read aloud ``` -![Screenshot of a Notification](./docs/macpopup.png?raw=true) - -Other supported parameters include `group` and `subtitle`. - -You can also remove notifications. However, this does not seem to work reliably. - -```julia -Notifier.remove() # removes all notifications -``` - -To remove specific notifications, you need to specify a group identifier when calling `notify`. This identifier can then be passed to `remove()`. - -```julia -notify("Notification A", group="group1") -notify("Notification B", group="group2") - -Notifier.remove("group1") -``` ### e-mail notification ```Julia @@ -122,7 +77,7 @@ 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. +If you use `email` function frequently, I recommend you to register your email address by `register_email` function. ```Julia julia> register_email() Type your desired recipient e-mail address to receive a notification. @@ -137,16 +92,5 @@ After you registered, you don't need to specify e-mail address. email("message") ``` -# Windows (Experimental) -## Usage -```Julia -using Notifier -notify("calculation done") -# defalut title is "Julia". -# You can change the title by title option. -notify("calculation done", title="foofoo") -notify("calculation done", sound=true) # with sound -notify("calculation done", sound="foo.wav") # specify a sound file -alarm() # only sound. You can specify a sound file, alarm(sound="foo.wav") -``` -![Screenshot of a Notification](./docs/winpopup.png?raw=true) +## Acknowledgement +Inspired by [OSXNotifier.jl](https://github.com/jonasrauber/OSXNotifier.jl). diff --git a/src/linux.jl b/src/linux.jl index 92fcb92..c0b4ab8 100644 --- a/src/linux.jl +++ b/src/linux.jl @@ -1,5 +1,5 @@ import Base.notify -export notify, alarm, register_email, email +export notify, alarm, say, register_email, email include("email.jl") @@ -39,3 +39,12 @@ function alarm(;sound::AbstractString=joinpath(@__DIR__, "default.wav")) @async run(`aplay -q $sound`) return nothing end + +""" + Notifier.say(message::AbstractString) + +Read a given message aloud. +""" +function say(msg::AbstractString) + run(`espeak $msg`) +end diff --git a/test/linux_test.jl b/test/linux_test.jl index e69699d..6abb146 100644 --- a/test/linux_test.jl +++ b/test/linux_test.jl @@ -28,3 +28,9 @@ end catch false end +@test try + say("Hello") + true +catch + false +end From f331f9f54cb39e319a604cb551241211ccb3e5a3 Mon Sep 17 00:00:00 2001 From: goropikari Date: Sun, 4 Mar 2018 19:04:04 +0900 Subject: [PATCH 3/5] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a68fa1f..0cea2e2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Notifier +[![Notifier](http://pkg.julialang.org/badges/Notifier_0.6.svg)](http://pkg.julialang.org/detail/Notifier) +[![Notifier](http://pkg.julialang.org/badges/Notifier_0.7.svg)](http://pkg.julialang.org/detail/Notifier) [![Build Status](https://travis-ci.org/goropikari/Notifier.jl.svg?branch=master)](https://travis-ci.org/goropikari/Notifier.jl) [![codecov.io](http://codecov.io/github/goropikari/Notifier.jl/coverage.svg?branch=master)](http://codecov.io/github/goropikari/Notifier.jl?branch=master) From d9daa39176582e1a4a1ce587b722e8327fb1205c Mon Sep 17 00:00:00 2001 From: goropikari Date: Wed, 7 Mar 2018 20:48:21 +0900 Subject: [PATCH 4/5] stderr to Null --- src/linux.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux.jl b/src/linux.jl index c0b4ab8..9748cb6 100644 --- a/src/linux.jl +++ b/src/linux.jl @@ -46,5 +46,5 @@ end Read a given message aloud. """ function say(msg::AbstractString) - run(`espeak $msg`) + run(pipeline(`espeak $msg`, stderr=DevNull)) end From 0cdee0e5bdfbd407bbaa687e9b81ae9ed63eea97 Mon Sep 17 00:00:00 2001 From: goropikari Date: Wed, 7 Mar 2018 21:09:42 +0900 Subject: [PATCH 5/5] add appveyor --- README.md | 1 + appveyor.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 appveyor.yml diff --git a/README.md b/README.md index 0cea2e2..e1c0133 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Notifier](http://pkg.julialang.org/badges/Notifier_0.6.svg)](http://pkg.julialang.org/detail/Notifier) [![Notifier](http://pkg.julialang.org/badges/Notifier_0.7.svg)](http://pkg.julialang.org/detail/Notifier) [![Build Status](https://travis-ci.org/goropikari/Notifier.jl.svg?branch=master)](https://travis-ci.org/goropikari/Notifier.jl) +[![Build status](https://ci.appveyor.com/api/projects/status/cv0ilbo2f6d43xcp?svg=true)](https://ci.appveyor.com/project/goropikari/notifier-jl) [![codecov.io](http://codecov.io/github/goropikari/Notifier.jl/coverage.svg?branch=master)](http://codecov.io/github/goropikari/Notifier.jl?branch=master) This package is notification tools for Julialang. diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..83a0be2 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,47 @@ +environment: + matrix: + - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe" + - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe" + - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" + - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" + +## uncomment the following lines to allow failures on nightly julia +## (tests will run but not make your overall status red) +matrix: + allow_failures: + - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" + - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" + +branches: + only: + - master + - /release-.*/ + +notifications: + - provider: Email + on_build_success: false + on_build_failure: false + on_build_status_changed: false + +install: + - ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12" +# If there's a newer build queued for the same PR, cancel this one + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + throw "There are newer queued builds for this pull request, failing early." } +# Download most recent Julia Windows binary + - ps: (new-object net.webclient).DownloadFile( + $env:JULIA_URL, + "C:\projects\julia-binary.exe") +# Run installer silently, output to C:\projects\julia + - C:\projects\julia-binary.exe /S /D=C:\projects\julia + +build_script: +# Need to convert from shallow to complete for Pkg.clone to work + - IF EXIST .git\shallow (git fetch --unshallow) + - C:\projects\julia\bin\julia -e "versioninfo(); + Pkg.clone(pwd(), \"Notifier\"); Pkg.build(\"Notifier\")" + +test_script: + - C:\projects\julia\bin\julia -e "Pkg.test(\"Notifier\")"