mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Merge pull request #816 from kyechou/master
Fix the same issue as #81 but with nuke
This commit is contained in:
commit
558048b6cd
22
plugins/nuke
22
plugins/nuke
|
@ -89,10 +89,10 @@ is_mac() {
|
||||||
|
|
||||||
handle_pdf() {
|
handle_pdf() {
|
||||||
if [ "$GUI" -ne 0 ] && is_mac; then
|
if [ "$GUI" -ne 0 ] && is_mac; then
|
||||||
open "${FPATH}" >/dev/null 2>&1 &
|
nohup open "${FPATH}" >/dev/null 2>&1 &
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$GUI" -ne 0 ] && which zathura >/dev/null 2>&1; then
|
elif [ "$GUI" -ne 0 ] && which zathura >/dev/null 2>&1; then
|
||||||
zathura "${FPATH}" >/dev/null 2>&1 &
|
nohup zathura "${FPATH}" >/dev/null 2>&1 &
|
||||||
exit 0
|
exit 0
|
||||||
elif which pdftotext >/dev/null 2>&1; then
|
elif which pdftotext >/dev/null 2>&1; then
|
||||||
## Preview as text conversion
|
## Preview as text conversion
|
||||||
|
@ -128,13 +128,13 @@ handle_audio() {
|
||||||
|
|
||||||
handle_video() {
|
handle_video() {
|
||||||
if [ "$GUI" -ne 0 ] && is_mac; then
|
if [ "$GUI" -ne 0 ] && is_mac; then
|
||||||
open "${FPATH}" >/dev/null 2>&1 &
|
nohup open "${FPATH}" >/dev/null 2>&1 &
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$GUI" -ne 0 ] && which smplayer >/dev/null 2>&1; then
|
elif [ "$GUI" -ne 0 ] && which smplayer >/dev/null 2>&1; then
|
||||||
smplayer "${FPATH}" >/dev/null 2>&1 &
|
nohup smplayer "${FPATH}" >/dev/null 2>&1 &
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$GUI" -ne 0 ] && which mpv >/dev/null 2>&1; then
|
elif [ "$GUI" -ne 0 ] && which mpv >/dev/null 2>&1; then
|
||||||
mpv "${FPATH}" >/dev/null 2>&1 &
|
nohup mpv "${FPATH}" >/dev/null 2>&1 &
|
||||||
exit 0
|
exit 0
|
||||||
elif which ffmpegthumbnailer >/dev/null 2>&1; then
|
elif which ffmpegthumbnailer >/dev/null 2>&1; then
|
||||||
# Thumbnail
|
# Thumbnail
|
||||||
|
@ -275,7 +275,11 @@ load_dir() {
|
||||||
count="$(listimages | grep -a -m 1 -ZznF "$target" | cut -d: -f1)"
|
count="$(listimages | grep -a -m 1 -ZznF "$target" | cut -d: -f1)"
|
||||||
|
|
||||||
if [ -n "$count" ]; then
|
if [ -n "$count" ]; then
|
||||||
listimages | xargs -0 "$1" -n "$count" --
|
if [ "$GUI" -ne 0 ]; then
|
||||||
|
listimages | xargs -0 nohup "$1" -n "$count" --
|
||||||
|
else
|
||||||
|
listimages | xargs -0 "$1" -n "$count" --
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
shift
|
shift
|
||||||
"$1" -- "$@" # fallback
|
"$1" -- "$@" # fallback
|
||||||
|
@ -305,7 +309,7 @@ handle_multimedia() {
|
||||||
## Image
|
## Image
|
||||||
image/*)
|
image/*)
|
||||||
if [ "$GUI" -ne 0 ] && is_mac; then
|
if [ "$GUI" -ne 0 ] && is_mac; then
|
||||||
open "${FPATH}" >/dev/null 2>&1 &
|
nohup open "${FPATH}" >/dev/null 2>&1 &
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$GUI" -ne 0 ] && which imvr >/dev/null 2>&1; then
|
elif [ "$GUI" -ne 0 ] && which imvr >/dev/null 2>&1; then
|
||||||
load_dir imvr "${FPATH}" >/dev/null 2>&1 &
|
load_dir imvr "${FPATH}" >/dev/null 2>&1 &
|
||||||
|
@ -476,10 +480,10 @@ handle_mime() {
|
||||||
|
|
||||||
handle_fallback() {
|
handle_fallback() {
|
||||||
if [ "$GUI" -ne 0 ] && which xdg-open >/dev/null 2>&1; then
|
if [ "$GUI" -ne 0 ] && which xdg-open >/dev/null 2>&1; then
|
||||||
xdg-open "${FPATH}" >/dev/null 2>&1 &
|
nohup xdg-open "${FPATH}" >/dev/null 2>&1 &
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$GUI" -ne 0 ] && which open >/dev/null 2>&1; then
|
elif [ "$GUI" -ne 0 ] && which open >/dev/null 2>&1; then
|
||||||
open "${FPATH}" >/dev/null 2>&1 &
|
nohup open "${FPATH}" >/dev/null 2>&1 &
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue