Package: xdg-utils / 1.1.0~rc1+git20111210-7.4+deb8u1

no-X.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
--- a/scripts/xdg-open.in
+++ b/scripts/xdg-open.in
@@ -191,25 +191,29 @@ open_generic()
         fi
         check_input_file "$file"
 
-        open_generic_xdg_file_mime "$file"
+        if [ -n "$DISPLAY" ]; then
+            open_generic_xdg_file_mime "$file"
 
-        if [ -f /etc/debian_version ] &&
-            which run-mailcap 2>/dev/null 1>&2; then
-            run-mailcap --action=view "$file"
-            if [ $? -eq 0 ]; then
-                exit_success
+            if mimeopen -v 2>/dev/null 1>&2; then
+                mimeopen -L -n "$file"
+                if [ $? -eq 0 ]; then
+                    exit_success
+                fi
             fi
         fi
 
-        if mimeopen -v 2>/dev/null 1>&2; then
-            mimeopen -L -n "$file"
+        if [ -f /etc/debian_version ] &&
+            which run-mailcap 2>/dev/null 1>&2; then
+            run-mailcap --action=view "$file"
             if [ $? -eq 0 ]; then
                 exit_success
             fi
         fi
     fi
 
-    open_generic_xdg_x_scheme_handler "$1"
+    if [ -n "$DISPLAY" ]; then
+        open_generic_xdg_x_scheme_handler "$1"
+    fi
 
     OLDIFS="$IFS"
     IFS=":"
@@ -222,9 +226,14 @@ open_generic()
                 browser_with_arg=$browser;
             fi
 
+            local redirect_output=''
+            if [ -n "$DISPLAY" ]; then
+                redirect_output="$xdg_redirect_output"
+            fi
+
             if [ x"$browser_with_arg" = x"$browser" ]; then
-                eval '$browser $1'$xdg_redirect_output;
-            else eval '$browser_with_arg'$xdg_redirect_output;
+                eval '$browser $1'$redirect_output;
+            else eval '$browser_with_arg'$redirect_output;
             fi
 
             if [ $? -eq 0 ]; then
@@ -297,7 +306,7 @@ DEBUG 2 "Selected DE $DE"
 
 # if BROWSER variable is not set, check some well known browsers instead
 if [ x"$BROWSER" = x"" ]; then
-    BROWSER=links2:elinks:links:lynx:w3m
+    BROWSER=www-browser:links2:elinks:links:lynx:w3m
     if [ -n "$DISPLAY" ]; then
         BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER
     fi
--- a/scripts/xdg-email.in
+++ b/scripts/xdg-email.in
@@ -405,7 +405,7 @@ fi
 
 # if BROWSER variable is not set, check some well known browsers instead
 if [ x"$BROWSER" = x"" ]; then
-    BROWSER=links2:elinks:links:lynx:w3m
+    BROWSER=www-browser:links2:elinks:links:lynx:w3m
     if [ -n "$DISPLAY" ]; then
         BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER
     fi