2019-12-11 19:26:39 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
# Description: Show a notification
|
|
|
|
#
|
|
|
|
# Details: nnn invokes this plugin to show notification when a cp/mv/rm operation is complete.
|
|
|
|
#
|
2020-08-09 21:44:11 +00:00
|
|
|
# Dependencies: notify-send (Ubuntu)/ntfy (https://github.com/dschep/ntfy)/osascript (macOS)/notify (Haiku)
|
2019-12-11 19:26:39 +00:00
|
|
|
#
|
|
|
|
# Shell: POSIX compliant
|
|
|
|
# Author: Anna Arad
|
|
|
|
|
|
|
|
OS="$(uname)"
|
|
|
|
|
|
|
|
if which notify-send >/dev/null 2>&1; then
|
|
|
|
notify-send nnn "Done!"
|
|
|
|
elif [ "$OS" = "Darwin" ]; then
|
|
|
|
osascript -e 'display notification "Done!" with title "nnn"'
|
|
|
|
elif which ntfy >/dev/null 2>&1; then
|
|
|
|
ntfy -t nnn send "Done!"
|
2020-08-09 21:44:11 +00:00
|
|
|
elif [ "$OS" = "Haiku" ]; then
|
|
|
|
notify --title "nnn" "Done!"
|
2019-12-11 19:26:39 +00:00
|
|
|
fi
|