richerlariviere / shout

Easily send notification to macOS "Notification Center"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shout

Easily send notification to macOS "Notification Center"

Disclaimer: This is very naive code. Do not use it without having a complete knowledge of the code (which is very simple). I plan to clean the inputs laters. At this moment, the code is only usable for measuring execution time and output it in a notification.

Usage

git clone https://github.com/richerlariviere/shout.git
cd shout
# Compile the project
swiftc -o shout main.swift

Add this function to your ~/.bash_profile (do not forget to edit the path/to/shout/program)

shout() {
  start=$(date "+%s")
  $@
  end=$(date "+%s")
  runtime=$(($end-$start))
  path/to/shout/program/shout $runtime $@
}

Refresh ~/.bash_profile: source ~/.bash_profile

shout <your script>

# Example
shout ping -c 4 google.com
# The notification should appear after that

About

Easily send notification to macOS "Notification Center"

License:MIT License


Languages

Language:Swift 100.0%