aboutsummaryrefslogtreecommitdiff
path: root/files/.config/nnn/plugins/.ntfy
diff options
context:
space:
mode:
authorAnton Bobov <anton@bobov.name>2023-10-25 19:17:11 +0500
committerAnton Bobov <anton@bobov.name>2023-10-27 14:26:55 +0500
commit62c95ef2f3a2374ddda52302d54801cfe442484d (patch)
tree8b74bb0bee41cf62bc9149429dac7b0f81123919 /files/.config/nnn/plugins/.ntfy
parent748cafebaf85b9827c8d3df4535a1a34ddbe82fd (diff)
[nnn] Add getplugs plugin and update all plugins
Diffstat (limited to 'files/.config/nnn/plugins/.ntfy')
-rwxr-xr-xfiles/.config/nnn/plugins/.ntfy22
1 files changed, 22 insertions, 0 deletions
diff --git a/files/.config/nnn/plugins/.ntfy b/files/.config/nnn/plugins/.ntfy
new file mode 100755
index 0000000..2a61478
--- /dev/null
+++ b/files/.config/nnn/plugins/.ntfy
@@ -0,0 +1,22 @@
+#!/usr/bin/env sh
+
+# Description: Show a notification
+#
+# Details: nnn invokes this plugin to show notification when a cp/mv/rm operation is complete.
+#
+# Dependencies: notify-send (Ubuntu)/ntfy (https://github.com/dschep/ntfy)/osascript (macOS)/notify (Haiku)
+#
+# Shell: POSIX compliant
+# Author: Anna Arad
+
+OS="$(uname)"
+
+if type notify-send >/dev/null 2>&1; then
+ notify-send nnn "Done!"
+elif [ "$OS" = "Darwin" ]; then
+ osascript -e 'display notification "Done!" with title "nnn"'
+elif type ntfy >/dev/null 2>&1; then
+ ntfy -t nnn send "Done!"
+elif [ "$OS" = "Haiku" ]; then
+ notify --title "nnn" "Done!"
+fi