]> Sergey Matveev's repositories - nnn.git/commitdiff
which prints to screen
authorArun Prakash Jana <engineerarun@gmail.com>
Tue, 5 May 2020 23:06:26 +0000 (04:36 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Tue, 5 May 2020 23:06:26 +0000 (04:36 +0530)
plugins/preview-tabbed

index db94fdca2f596738515f2ac21c00065b32326ef0..7e7e8400bb884099938d8f0720c6b7d1e246776f 100755 (executable)
@@ -54,11 +54,11 @@ PAGER=${PAGER:-"vim -R"}
 NUKE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke"
 
 
-if which xterm ; then
+if which xterm >/dev/null 2>&1 ; then
     TERMINAL="xterm -into"
-elif which urxvt ; then
+elif which urxvt >/dev/null 2>&1 ; then
     TERMINAL="urxvt -embed"
-elif which st ; then
+elif which st >/dev/null 2>&1 ; then
     TERMINAL="st -w"
 else
     echo "No xembed term found" >&2
@@ -131,28 +131,28 @@ previewer_loop () {
 
         case "$MIME" in
             video/*)
-                if which mpv ; then
+                if which mpv >/dev/null 2>&1 ; then
                     mpv --force-window=immediate --loop-file --wid="$XID" "$FILE" &
                 else
                     term_nuke "$XID" "$FILE"
                 fi
                 ;;
             audio/*)
-                if which mpv ; then
+                if which mpv >/dev/null 2>&1 ; then
                     mpv --force-window=immediate --loop-file --wid="$XID" "$FILE" &
                 else
                     term_nuke "$XID" "$FILE"
                 fi
                 ;;
             image/*)
-                if which sxiv ; then
+                if which sxiv >/dev/null 2>&1 ; then
                     sxiv -e "$XID" "$FILE" &
                 else
                     term_nuke "$XID" "$FILE"
                 fi
                 ;;
             application/pdf)
-                if which zathura ; then
+                if which zathura >/dev/null 2>&1 ; then
                     zathura -e "$XID" "$FILE" &
                 else
                     term_nuke "$XID" "$FILE"