matryer / xbar

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
https://xbarapp.com
MIT License
17.5k stars 642 forks source link

add a way to send a notification when an action is done #741

Closed pvinis closed 3 years ago

pvinis commented 3 years ago

For example, it would be cool to have something like

echo "do my action | shell=~/myscript.sh notif=true"

so that when I click the action, my script runs, and once the script is done, I get a notification.

It would be extremely useful for scripts that take some time, and not just a few milliseconds.

matryer commented 3 years ago

It's possible to solve this yourself by using the control API to refresh the plugin at the end of the myscript.sh. I'm not sure what other kind of notification is possible.

pvinis commented 3 years ago

I was thinking more like a regular macos notification, or something like https://github.com/BlueHuskyStudios/BHBezelNotification/ or anything else. Something that I could add when I want a way to know that something very obviously finished.

matryer commented 3 years ago

You can do it with Apple Script, see https://code-maven.com/display-notification-from-the-mac-command-line - hope this helps

pvinis commented 3 years ago

It does, and that's what I'll do for now, but I think that would be a great addition like terminal=true, to have a notif=true or notif="Job Done!" or similar. If you agree, let's reopen, and I might even try to add this 😬. If not, then keep it closed.