aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGravatar CodeforEvolution <secundaja@gmail.com>2020-08-09 16:44:11 -0500
committerGravatar CodeforEvolution <secundaja@gmail.com>2020-08-09 22:19:51 -0500
commit6f9571a805e715d38ad6f5c7594a7e829368d617 (patch)
tree40ccadbf0287ea9ad4da4ae477eed26b212c025e /plugins
parent966fe839eee2f25ec2ed548234c9edfe984ebcfa (diff)
downloadnnn-6f9571a805e715d38ad6f5c7594a7e829368d617.tar.gz
Haiku: General fixup, add icon, add rdef file
- Add a native vector icon for Haiku (it hasn't been Haiku-ified yet however) - Add a rdef file (specifies application metadata) - Add clipboard support, notififcation support, and basic nuke support - Fix support for fortunes on Haiku ("-s" option is not available on Haiku) - Cleanup Haiku recipe
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/.cbcp4
-rwxr-xr-xplugins/.ntfy4
-rwxr-xr-xplugins/nuke14
-rwxr-xr-xplugins/x2sel4
4 files changed, 21 insertions, 5 deletions
diff --git a/plugins/.cbcp b/plugins/.cbcp
index bd9910a..04a09dc 100755
--- a/plugins/.cbcp
+++ b/plugins/.cbcp
@@ -9,6 +9,7 @@
# - clip.exe (WSL)
# - clip (Cygwin)
# - wl-copy (Wayland)
+# - clipboard (Haiku)
#
# Limitation: breaks if a filename has newline in it
#
@@ -43,4 +44,7 @@ elif which clip >/dev/null 2>&1; then
elif which wl-copy >/dev/null 2>&1; then
# Wayland
tr '\0' '\n' < "$selection" | wl-copy
+elif which clipboard >/dev/null 2>&1; then
+ # Haiku
+ tr '\0' '\n' < "$selection" | clipboard --stdin
fi
diff --git a/plugins/.ntfy b/plugins/.ntfy
index 590ebbd..3a7f27f 100755
--- a/plugins/.ntfy
+++ b/plugins/.ntfy
@@ -4,7 +4,7 @@
#
# 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)
+# Dependencies: notify-send (Ubuntu)/ntfy (https://github.com/dschep/ntfy)/osascript (macOS)/notify (Haiku)
#
# Shell: POSIX compliant
# Author: Anna Arad
@@ -17,4 +17,6 @@ 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!"
+elif [ "$OS" = "Haiku" ]; then
+ notify --title "nnn" "Done!"
fi
diff --git a/plugins/nuke b/plugins/nuke
index 2c47ce0..f2abe65 100755
--- a/plugins/nuke
+++ b/plugins/nuke
@@ -32,7 +32,7 @@
# 3. Start GUI apps in bg to unblock. Redirect stdout and strerr if required.
# 4. Some CLI utilities are piped to the $PAGER, to wait and quit uniformly.
# 5. If the output cannot be paged use "read -r _" to wait for user input.
-# 6. On a DE, try 'xdg-open' in handle_fallback() as last resort.
+# 6. On a DE, try 'xdg-open' or 'open' in handle_fallback() as last resort.
#
# Feel free to change the utilities to your favourites and add more mimes.
#
@@ -42,7 +42,7 @@
# rar: list with unrar
# 7-zip: list with 7z
# pdf: zathura (GUI), pdftotext, mutool, exiftool
-# audio: mocplay (nnn plugin using MOC), mpv, mediainfo, exiftool
+# audio: mocplay (nnn plugin using MOC), mpv, media_client (Haiku), mediainfo, exiftool
# avi|mkv|mp4: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool
# log: vi
# torrent: rtorrent, transmission-show
@@ -53,7 +53,7 @@
# Multimedia by mime:
# image/*: imv/sxiv (GUI), viu (https://github.com/atanunq/viu), img2txt, exiftool
# video/*: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool
-# audio/*: mocplay (nnn plugin using MOC), mpv, mediainfo, exiftool
+# audio/*: mocplay (nnn plugin using MOC), mpv, media_client (Haiku), mediainfo, exiftool
# application/pdf: zathura (GUI), pdftotext, mutool, exiftool
# Other mimes:
# text/troff: man -l
@@ -107,6 +107,9 @@ handle_audio() {
elif which mpv >/dev/null 2>&1; then
mpv "${FPATH}" >/dev/null 2>&1 &
exit 0
+ elif which media_client >/dev/null 2>&1; then
+ media_client play "${FPATH}" >/dev/null 2>&1 &
+ exit 0
elif which mediainfo >/dev/null 2>&1; then
mediainfo "${FPATH}" | eval "$PAGER"
exit 0
@@ -459,9 +462,12 @@ handle_mime() {
}
handle_fallback() {
- if [ "$GUI" -ne 0 ]; then
+ if [ "$GUI" -ne 0 ] && which xdg-open >/dev/null 2>&1; then
xdg-open "${FPATH}" >/dev/null 2>&1 &
exit 0
+ elif [ "$GUI" -ne 0 ] && which open >/dev/null 2>&1; then
+ open "${FPATH}" >/dev/null 2>&1 &
+ exit 0
fi
echo '----- File details -----' && file --dereference --brief -- "${FPATH}"
diff --git a/plugins/x2sel b/plugins/x2sel
index 09ac68f..0a0fcd4 100755
--- a/plugins/x2sel
+++ b/plugins/x2sel
@@ -9,6 +9,7 @@
# - powershell (WSL)
# - cygwim's /dev/clipboard (Cygwin)
# - wl-paste (Wayland)
+# - clipboard (Haiku)
#
# Limitation: breaks if a filename has newline in it
#
@@ -42,6 +43,9 @@ getclip () {
elif which wl-paste >/dev/null 2>&1; then
# Wayland
wl-paste
+ elif which clipboard >/dev/null 2>&1; then
+ # Haiku
+ clipboard --print
fi
}