Index: xdg-email.in =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-email.in,v retrieving revision 1.18 diff -u -r1.18 xdg-email.in --- xdg-email.in 4 Aug 2006 00:59:03 -0000 1.18 +++ xdg-email.in 8 Sep 2006 11:02:27 -0000 @@ -66,6 +66,26 @@ fi } +open_generic() +{ + IFS=":" + for browser in $BROWSER; do + if [ x"$browser" != x"" ]; then + + browser_with_arg=`echo "$browser" | sed s#%s#"$1"#` + + if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1"; + else $browser_with_arg; + fi + + if [ $? -eq 0 ]; then exit_success; + fi + fi + done + + exit_failure_operation_impossible "no method available for opening '$1'" +} + url_encode() { result=$(echo "$1" | $utf8 | awk ' @@ -217,6 +237,14 @@ detectDE +if [ x"$DE" = x"" ]; then + # if BROWSER variable is not set, check some well known browsers instead + if [ x"$BROWSER" = x"" ]; then + BROWSER=firefox:mozilla:netscape + fi + DE=generic +fi + case "$DE" in kde) open_kde "${mailto}" @@ -230,6 +258,10 @@ open_xfce "${mailto}" ;; + generic) + open_generic "${mailto}" + ;; + *) exit_failure_operation_impossible "no method available for opening '${mailto}'" ;;