Source

screentime-monitor / notify.ml

Full commit
open Core.Std
open Async.Std

let spawn ~title ?sound ?execute message =
  Async_shell.run
    "terminal-notifier"
    ( [ "-message" ; message ]
      @ [ "-title"; title ]
      @ (match sound with
          | None -> []
          | Some sound ->
            [ "-sound"; (match sound with `Default -> "default" | `Path x -> x) ])
      @ (match execute with
          | None -> []
          | Some command -> [ "-execute";command ])
    )