aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/.ntfy
blob: fe0e18a5b2ea7f1c22830340b39fe654bfdb6579 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env sh

# Description: Show a notification
#
# Details: nnn invokes this plugin to show notification when a cp/mv/rm operation is complete.
#
# Requires: notify-send (Ubuntu)/ntfy (https://github.com/dschep/ntfy)/osascript (macOS)
#
# 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!"
fi