Giter VIP home page Giter VIP logo

Comments (5)

alloy avatar alloy commented on May 22, 2024

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.

dsomar avatar dsomar commented on May 22, 2024

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.

mklement0 avatar mklement0 commented on May 22, 2024

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.

adilinden avatar adilinden commented on May 22, 2024

I've made use of it in an AppleScript wrapper for rsync http://adis.ca/post/applescript-rsync/

from terminal-notifier.

alloy avatar alloy commented on May 22, 2024

I’ve added a few examples to the REAME. Thanks.

from terminal-notifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.