Browse Source

changed type of checking: used -n operator instead of -z

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Slava Zanko 12 years ago
parent
commit
aa5ffa2b87
4 changed files with 21 additions and 21 deletions
  1. 3 3
      misc/ext.d/doc.sh.in
  2. 3 3
      misc/ext.d/image.sh
  3. 12 12
      misc/ext.d/sound.sh
  4. 3 3
      misc/ext.d/video.sh

+ 3 - 3
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)

+ 3 - 3
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

+ 12 - 12
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
         ;;
     *)

+ 3 - 3
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 &)