[ANN] Alert.jl - Simple desktop notifications

Hi all,

I created a very small, simple package (Alert) for getting a desktop notification (a.k.a. “toast”) across platforms. Like so:

using Alert

for i in 1:10_000
    long_running_function()
end

alert("Your julia script is finished!")

I find it helpful when I’m running something time consuming and want to know when it’s finished while doing other work.

I’ve tested it on MacOS and Windows 10, but I don’t have a linux system handy, so if someone could try it out and confirm that it pops up a notification of some sort, that would be really helpful.

Hope it’s useful to folks!

43 Likes

On Linux:

(@v1.4) pkg> add Alert
Updating registry at ~/.julia/registries/General
Updating git-repo https://github.com/JuliaRegistries/General.git
ERROR: The following package names could not be resolved:

  • Alert (not found in project, manifest or registry)

When cloned and ran I get the following:


julia> include("src/Alert.jl")
Main.Alert

julia> Alert.alert("as")
Process(`notify-send as`, ProcessExited(0))

and Ubuntu displays a notification at the top (as I just noticed). Seems to work as intended.

1 Like
pkg> add https://github.com/haberdashPI/Alert.jl

Right, I didn’t think of that, thanks.

Great idea!!!

Lovely package! Works perfectly on my MacOS machine.

cc @yakir12 - this was something you were looking for earlier, I think…

1 Like

Thanks! Right you are !

Thanks! Will you register it?

Already, registered! Just waiting for the auto megre delay (3 days).

5 Likes

Doesn’t work from within VSCode on Windows.

Hi @xiadoai; can you give me some more details? I am not having any problem running it on Windows 10 on my machine. Do you get any error message? Your windows version? (I am also running it from within VSCode; that shouldn’t matter though).

I just get this in the REPL but no notification

Process(`powershell.exe -Enc JABFAHIAcgBvAHIAQQBjAHQAaQBvAG4AUAByAGUAZgBlAHIAZQBuAGMAZQAgAD0AIAAiAFMAdABvAHAAIgAKAAoAJABuAG8AdABpAGYAaQBjAGEAdABpAG8AbgBUAGkAdABsAGUAIAA9ACAAIgBZAG8AdQByACAAagB1AGwAaQBhACAAcwBjAHIAaQBwAHQAIABpAHMAIABmAGkAbgBpAHMAaABlAGQAIQAiAAoACgBbAFcAaQBuAGQAbwB3AHMALgBVAEkALgBOAG8AdABpAGYAaQBjAGEAdABpAG8AbgBzAC4AVABvAGEAcwB0AE4AbwB0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UAG8AYQBzAHQATgBvAHQAaQBmAGkAZQByACgAIgBQAG8AdwBlAHIAUwBoAGUAbABsACIAKQAKACQAbgBvAHQAaQBmAGkAZQByAC4AUwBoAG8AdwAoACQAdABvAGEAcwB0ACkAOwAKAA==`, ProcessExited(0))

Does Julia hang or does the command complete? What version of windows?

Finished. Wondows 10 pro

Do you have notifications turned on? I just saw that the Julia command returns with ProcessExited(0) in the output you posted. That means that there was no error in running the power shell script (so as far as Julia can tell the command worked). Under the OS settings you should see something like the following:

That’s the only explanation I can currently think of for why you aren’t seeing anything. If that isn’t the problem, if you could give me some more details about exactly what you’re doing that would be really helpful.

1 Like

you are right. i have it turned off :face_with_head_bandage:

1 Like

alert :partying_face:

3 Likes

For those interested, I have now also created a small extension to Alert called AlertPushover: it allows you to get notifications on your phone or browser from a remote Julia session.

3 Likes