cortesi / modd

A flexible developer tool that runs processes and responds to filesystem changes
MIT License
2.8k stars 128 forks source link

add modd-notifier support #73

Closed rphillips closed 2 years ago

rphillips commented 5 years ago

This PR changes modd to allow for modd-notifier support, which is simply an external custom program or shell script to notify the user. I would like to redirect notifications to noti for push notifications. Below is a sample script in my path, enabled with: modd -n -t modd-notify

modd-notifier (for noti):

#!/bin/sh

title=""
message=""

while getopts ":t:m:" opt; do
  case ${opt} in
    t )
      title=$OPTARG
      ;;
    m )
      message=$OPTARG
      ;;
    \? ) echo "Usage: modd-notifier -t "title" -m "message"
      ;;
  esac
done

noti -t "$title" -m "$message"