diff --git a/mc-x11browser.diff b/mc-x11browser.diff index 721275c..866ff20 100644 --- a/mc-x11browser.diff +++ b/mc-x11browser.diff @@ -8,7 +8,7 @@ Index: misc/mc.ext.in regex/\.([hH][tT][mM][lL]?)$ - Open=(if test -n "@X11_WWW@" && test -n "$DISPLAY"; then (@X11_WWW@ file://%d/%p &) 1>&2; else links %f || lynx -force_html %f || ${PAGER:-more} %f; fi) 2>/dev/null - View=%view{ascii} links -dump %f 2>/dev/null || w3m -dump %f 2>/dev/null || lynx -dump -force_html %f -+ Open=/usr/share/mc/bin/x11_browser %f ++ Open=/usr/share/mc/x11_browser file://%f + View=%view{ascii} w3m -dump -T text/html %f; # StarOffice 5.2 diff --git a/mc.changes b/mc.changes index fef454e..0dbbcfe 100644 --- a/mc.changes +++ b/mc.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sat Mar 24 08:54:23 UTC 2012 - subchaser1@gmail.com + +- x11_browser issues fixed + * use xdg-open if it possible + * HTML-files openning fixed + * firefox & chromium detection added + ------------------------------------------------------------------- Wed Mar 21 06:33:55 UTC 2012 - subchaser1@gmail.com diff --git a/x11_browser b/x11_browser index 3380222..cf861a0 100644 --- a/x11_browser +++ b/x11_browser @@ -10,6 +10,10 @@ url="$1" method="${1%%:*}" +if test -n "$DISPLAY" -a -x /usr/bin/xdg-open ; then + exec /usr/bin/xdg-open "$url" +fi + if test "$url" = "$method" ; then case "${url}" in */*.htm|*/*.html) method=http ;; @@ -41,8 +45,11 @@ case "$method" in test -n "$DISPLAY" && type -p Netscape >& /dev/null && http=Netscape test -n "$DISPLAY" && type -p opera >& /dev/null && http=opera test -n "$DISPLAY" && type -p mozilla >& /dev/null && http=mozilla + test -n "$DISPLAY" && type -p firefox >& /dev/null && http=firefox + test -n "$DISPLAY" && type -p chromium >& /dev/null && http=chromium case "$http" in - [nN]etscape|opera|mozilla) ($http -remote "openURL($url)" || $http "$url") >/dev/null 2>&1 & ;; + chromium) $http "$url" >/dev/null 2>&1 & ;; + [nN]etscape|opera|mozilla|firefox) ($http -remote "openURL($url)" || $http "$url") >/dev/null 2>&1 & ;; lynx|w3m|links) exec $http "$url" ;; *) echo "No HTTP browser found."