which prints to screen

This commit is contained in:
Arun Prakash Jana 2020-05-06 04:36:26 +05:30
parent 33c4b1e7a2
commit c360f5c908
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

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