--- misc/ext.d/video.sh.orig 2012-12-27 12:13:20.000000000 +0400 +++ misc/ext.d/video.sh 2013-03-09 12:29:54.845011661 +0400 @@ -6,7 +6,18 @@ action=$1 filetype=$2 -[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="xdg-open" +[ -n "${MC_XDG_OPEN}" ] || MC_XDG_OPEN="_xdg_open" + +_xdg_open() +{ + if [ -n "$DISPLAY" ] && type -p gmplayer ; then + gmplayer "${MC_EXT_FILENAME}" + elif type -p mplayer ; then + mplayer "${MC_EXT_FILENAME}" + else + xdg-open "${MC_EXT_FILENAME}" + fi +} do_view_action() { filetype=$1 @@ -13,8 +13,14 @@ case "${filetype}" in *) - mplayer -identify -vo null -ao null -frames 0 "${MC_EXT_FILENAME}" 2>&1 | \ - sed -n 's/^ID_//p' + if type -p mediainfo >/dev/null 2>&1 ; then + mediainfo "${MC_EXT_FILENAME}" + elif type -p mplayer >/dev/null 2>&1 ; then + mplayer -identify -vo null -ao null -frames 0 "${MC_EXT_FILENAME}" 2>&1 | \ + sed -n 's/^ID_//p' + else + file "${MC_EXT_FILENAME}" + fi ;; esac }