Creating An Information Notification With Shell Scripts And Automator

You can go to the Terminal and use simple one-line shell scripts to get various pieces of information such as the date and time, your Internet IP address and your Wi-Fi network name. Using Automator, you can incorporate these bits of information into a simple notification that appears whenever you press a keyboard shortcut.



Here is the line of code for the date and time:

date '+%A, %B %d, %Y %I:%M:%S %p'

Here is the line of code for the IP address:

curl -s http://ipecho.net/plain

Here is the line of code for the Wi-Fi network name:

networksetup -getairportnetwork en2 | awk -F": " '{print $2}'

Comments: One Response to “Creating An Information Notification With Shell Scripts And Automator”

    Al Jimenez
    4 years ago

    Great video. Good job. Now I gotta go think of other things to get notified on with this approach
    i.e: uptime="10:28 up 3 days ", pmset -g accps, and pmset -g ac. Endless... :-)

    Thanks.

Comments Closed.