Comments (5)
Yeah I should add one. In the meantime, there are many articles all over the web that explain it in more detail, for instance: http://osxdaily.com/2012/08/03/send-an-alert-to-notification-center-from-the-command-line-in-os-x/.
from terminal-notifier.
I just found this myself.
Once I typed in the the gem command, then I was able to get it working. Admittedly, I'm not that familiar with gems, so I'm about to become so.
Thanks again,
Denis
On Aug 29, 2012, at 10:34 AM, Eloy Durán [email protected] wrote:
Yeah I should add one. In the meantime, there are many articles all over the web that explain it in more detail, for instance: http://osxdaily.com/2012/08/03/send-an-alert-to-notification-center-from-the-command-line-in-os-x/.
—
Reply to this email directly or view it on GitHub.
from terminal-notifier.
Simple example for use in Terminal or in a shell script, assuming that terminal-notifier is either in /Applications, ~/Applications, or in a folder in your $PATH:
open -a terminal-notifier --args -message "Hello, world." -title "Some App"
Note: While the open -a
approach is simpler than calling the executable inside the bundle, its potential downside is that you get no stdout or stderr output. Still, if you know the syntax already, this can be handy - I suggest adding this information to the read-me.
Here's a wrapper shell script - save, for instance, as notify
and make executable - that assumes that the application is either in /Applications, or ~/Applications, or in the same folder as the script itself. Since the script calls the actual executable inside the application bundle, you do get stdout and stderr output, including command-line help.
#!/usr/bin/env bash
APP_NAME='terminal-notifier'
thisFolder=$(dirname "$BASH_SOURCE")
found=0
for exe in {/Applications,~/Applications,"$thisFolder"}"/${APP_NAME}.app/Contents/MacOS/$APP_NAME"; do
[[ -f "$exe" ]] && { found=1; break; }
done
(( found )) || { echo "ERROR: Cannot locate required application '$APP_NAME'" 1>&2; exit 1; }
# Invoke executable, passing all arguments through.
"$exe" "$@"
(As of 1.4.2) Note that while -h
and --help
do work for printing usage information, that appears to be an accident - usage information is printed whenever an unknown option is encountered, and these two happen to be just that.
from terminal-notifier.
I've made use of it in an AppleScript wrapper for rsync http://adis.ca/post/applescript-rsync/
from terminal-notifier.
I’ve added a few examples to the REAME. Thanks.
from terminal-notifier.
Related Issues (20)
- NSAllowsArbitraryLoads:true being labeled as a security issue HOT 6
- terminal-notifier hangs when not connected to UI session HOT 3
- -sender 'com.apple.AppStore' opens System Preferences, not the App Store app HOT 1
- Just use alerter? HOT 2
- macOS ARM support? (Apple Silicon) HOT 1
- `terminal-notifier` errors on macOS Big Sur HOT 11
- How button text(actions) supports Chinese HOT 1
- [INFO] macOS Big Sur 11.0 beta reports & issues HOT 13
- Snooze
- Stacked notifications? HOT 3
- -open: Click terminal-notification then brings another notification HOT 12
- -activate not work with icon.
- No Notification in macOS12.1 HOT 6
- dropping msg 1 app not found HOT 3
- Mention in README that sticky notifications can be controlled by System Prefs
- Fail to pop up when trigger in python subprogess with crontab -e HOT 1
- how can I customize alert sounds HOT 1
- Can't play system alert sounds on Ventura 13.1
- use -sender will stuck on ventura HOT 1
- notifications are muted and i can't unmute HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terminal-notifier.