Skip to content

Commit

Permalink
Assume terminal-notifier v2.0.0 is used, and remove alerter flags
Browse files Browse the repository at this point in the history
- Versions before terminal-notifier v2.0.0 had bugs related to "alerter" mode notifications.
- Workarounds were in place in `npshell`.
- Removed workarounds, assuming terminal-notifier v2.0.0 or higher is being used.

See

- julienXX/terminal-notifier#223
- https://github.com/julienXX/terminal-notifier/releases/tag/2.0.0
  • Loading branch information
joelpurra committed Dec 12, 2017
1 parent 3b4c1f1 commit 46f0240
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/shared/functions/notify.sh
Expand Up @@ -45,30 +45,16 @@ notify() {
(
# NOTE: forcefully close any previous notification, in case it wasn't already gone.
terminal-notifier \
-remove "np" \
-json >/dev/null
-remove "np" >/dev/null

# TODO: use the JSON output if the user clicks close/show/custom action?
# The closeLabel and alert actions are only shown if the user allows it to.
# - Open System Preferences > Notification.
# - Select "terminal-notifier" (or perhaps "np") in the sidebar.
# - Select the "Alerts" alert style.
# https://github.com/julienXX/terminal-notifier/raw/master/assets/System_prefs.png
#
# NOTE: Setting timeout due to bug in terminal-notifier.
# https://github.com/julienXX/terminal-notifier/issues/223
#
# NOTE: escaping the first character of title/subtitle/message, despite the bug being fixed.
# https://github.com/julienXX/terminal-notifier/issues/11
# NOTE: need to escaping the first character of title/subtitle/message; at least special characters such as square brackets '['.
terminal-notifier \
-group "np" \
-title "\\${title}" \
-open "https://github.com/joelpurra/npshell" \
-subtitle "\\${subtitle}" \
-message "\\${message}" \
-timeout "$configNotificationTimeout" \
-json >/dev/null
) &
-message "\\${message}" >/dev/null
) &
;;
'growlnotify')
# http://growl.info/downloads
Expand Down

0 comments on commit 46f0240

Please sign in to comment.