mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
Ticket #4479: prioritize console players for audio/video and images
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
parent
84af354d2a
commit
572312bd88
@ -6,7 +6,9 @@
|
|||||||
action=$1
|
action=$1
|
||||||
filetype=$2
|
filetype=$2
|
||||||
|
|
||||||
[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
|
if [ -n "$DISPLAY" ]; then
|
||||||
|
[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
|
||||||
|
fi
|
||||||
|
|
||||||
do_view_action() {
|
do_view_action() {
|
||||||
filetype=$1
|
filetype=$1
|
||||||
@ -50,10 +52,16 @@ do_open_action() {
|
|||||||
else
|
else
|
||||||
(gqview "${MC_EXT_FILENAME}" &)
|
(gqview "${MC_EXT_FILENAME}" &)
|
||||||
fi
|
fi
|
||||||
|
# no backgrounding for console viewers
|
||||||
|
elif which fim >/dev/null 2>&1; then
|
||||||
|
fim "${MC_EXT_FILENAME}"
|
||||||
|
elif which fbi >/dev/null 2>&1; then
|
||||||
|
fbi "${MC_EXT_FILENAME}"
|
||||||
|
elif which zgv >/dev/null 2>&1; then
|
||||||
|
zgv "${MC_EXT_FILENAME}"
|
||||||
|
# run-mailcap as a last resort
|
||||||
elif which see >/dev/null 2>&1; then
|
elif which see >/dev/null 2>&1; then
|
||||||
(see "${MC_EXT_FILENAME}" &)
|
(see "${MC_EXT_FILENAME}" &)
|
||||||
else
|
|
||||||
(zgv "${MC_EXT_FILENAME}" &)
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
action=$1
|
action=$1
|
||||||
filetype=$2
|
filetype=$2
|
||||||
|
|
||||||
[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
|
if [ -n "$DISPLAY" ]; then
|
||||||
|
[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
|
||||||
|
fi
|
||||||
|
|
||||||
do_view_action() {
|
do_view_action() {
|
||||||
filetype=$1
|
filetype=$1
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
action=$1
|
action=$1
|
||||||
filetype=$2
|
filetype=$2
|
||||||
|
|
||||||
[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
|
if [ -n "$DISPLAY" ]; then
|
||||||
|
[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open"
|
||||||
|
fi
|
||||||
|
|
||||||
do_view_action() {
|
do_view_action() {
|
||||||
filetype=$1
|
filetype=$1
|
||||||
@ -29,23 +31,16 @@ do_open_action() {
|
|||||||
filetype=$1
|
filetype=$1
|
||||||
|
|
||||||
if which mpv >/dev/null 2>&1; then
|
if which mpv >/dev/null 2>&1; then
|
||||||
PLAYER=mpv
|
PLAYER="mpv --really-quiet"
|
||||||
elif which mplayer >/dev/null 2>&1; then
|
|
||||||
PLAYER=mplayer
|
|
||||||
else
|
else
|
||||||
echo "Please install either mplayer or mpv to play this file"
|
PLAYER="mplayer -really-quiet"
|
||||||
return
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "${filetype}" in
|
|
||||||
*)
|
|
||||||
if [ -n "$DISPLAY" ]; then
|
if [ -n "$DISPLAY" ]; then
|
||||||
($PLAYER "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
($PLAYER "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)
|
||||||
else
|
else
|
||||||
$PLAYER -vo null "${MC_EXT_FILENAME}"
|
$PLAYER -vo null "${MC_EXT_FILENAME}"
|
||||||
fi
|
fi
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case "${action}" in
|
case "${action}" in
|
||||||
|
Loading…
Reference in New Issue
Block a user