From aa5ffa2b87be2de67b5d8d45e6fef35db77f23c9 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Tue, 26 Jun 2012 15:39:31 +0300 Subject: [PATCH] changed type of checking: used -n operator instead of -z Signed-off-by: Slava Zanko --- misc/ext.d/doc.sh.in | 6 +++--- misc/ext.d/image.sh | 6 +++--- misc/ext.d/sound.sh | 24 ++++++++++++------------ misc/ext.d/video.sh | 6 +++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/misc/ext.d/doc.sh.in b/misc/ext.d/doc.sh.in index 521642679..d59875332 100644 --- a/misc/ext.d/doc.sh.in +++ b/misc/ext.d/doc.sh.in @@ -142,11 +142,11 @@ do_open_action() { fmclient -f "${MC_EXT_FILENAME}" ;; dvi) - if [ -z "$DISPLAY" ]; then + if [ -n "$DISPLAY" ]; then + (xdvi "${MC_EXT_FILENAME}" &) + else dvisvga "${MC_EXT_FILENAME}" || \ dvi2tty "${MC_EXT_FILENAME}" | ${PAGER:-more} - else - (xdvi "${MC_EXT_FILENAME}" &) fi ;; djvu) diff --git a/misc/ext.d/image.sh b/misc/ext.d/image.sh index f19c02937..e09f92f9e 100644 --- a/misc/ext.d/image.sh +++ b/misc/ext.d/image.sh @@ -33,10 +33,10 @@ do_open_action() { (gimp "${MC_EXT_FILENAME}" &) ;; *) - if [ -z "$DISPLAY" ]; then - zgv "${MC_EXT_FILENAME}" - else + if [ -n "$DISPLAY" ]; then (gqview "${MC_EXT_FILENAME}" &) + else + zgv "${MC_EXT_FILENAME}" fi ;; esac diff --git a/misc/ext.d/sound.sh b/misc/ext.d/sound.sh index 962426358..913bf23c3 100644 --- a/misc/ext.d/sound.sh +++ b/misc/ext.d/sound.sh @@ -32,10 +32,10 @@ do_open_action() { case "${filetype}" in common) - if [ -z "$DISPLAY" ]; then - play "${MC_EXT_FILENAME}" - else + if [ -n "$DISPLAY" ]; then (xmms "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) + else + play "${MC_EXT_FILENAME}" fi ;; mod) @@ -46,17 +46,17 @@ do_open_action() { vplay -s 22 "${MC_EXT_FILENAME}" ;; mp3) - if [ -z "$DISPLAY" ]; then - mpg123 "${MC_EXT_FILENAME}" - else + if [ -n "$DISPLAY" ]; then (xmms "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) + else + mpg123 "${MC_EXT_FILENAME}" fi ;; ogg) - if [ -z "$DISPLAY" ]; then - ogg123 "${MC_EXT_FILENAME}" - else + if [ -n "$DISPLAY" ]; then (xmms "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) + else + ogg123 "${MC_EXT_FILENAME}" fi ;; midi) @@ -66,10 +66,10 @@ do_open_action() { mplayer -vo null "${MC_EXT_FILENAME}" ;; playlist) - if [ -z "$DISPLAY" ]; then - mplayer -vo null -playlist "${MC_EXT_FILENAME}" - else + if [ -n "$DISPLAY" ]; then (xmms -p "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) + else + mplayer -vo null -playlist "${MC_EXT_FILENAME}" fi ;; *) diff --git a/misc/ext.d/video.sh b/misc/ext.d/video.sh index 6db599c6a..bb89cee15 100644 --- a/misc/ext.d/video.sh +++ b/misc/ext.d/video.sh @@ -25,10 +25,10 @@ do_open_action() { (realplay "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) ;; *) - if [ -z "$DISPLAY" ]; then - mplayer -vo null "${MC_EXT_FILENAME}" - else + if [ -n "$DISPLAY" ]; then (mplayer "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) + else + mplayer -vo null "${MC_EXT_FILENAME}" fi #(gtv "${MC_EXT_FILENAME}" >/dev/null 2>&1 &) #(xanim "${MC_EXT_FILENAME}" >/dev/null 2>&1 &)