cmcfixes74: #i111960 use xdg-open when available

This commit is contained in:
Caolán McNamara 2010-05-31 14:19:35 +01:00
parent 5a13b18d8a
commit ac7fee6151
2 changed files with 34 additions and 24 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# use gnome-open utility coming with libgnome if available # use xdg-open or gnome-open if available
gnome-open "$1" 2>/dev/null || "$0.bin" $1 xdg-open "$1" 2>/dev/null || gnome-open "$1" 2>/dev/null || "$0.bin" $1
exit 0 exit 0

View File

@ -46,38 +46,48 @@ run_browser() {
# special handling for mailto: uris # special handling for mailto: uris
if echo $1 | grep '^mailto:' > /dev/null; then if echo $1 | grep '^mailto:' > /dev/null; then
# check for xdg-email
mailer=`which xdg-email`
if [ ! -z "$mailer" ]; then
$mailer "$1" &
exit 0
fi
# check $MAILER variable # check $MAILER variable
if [ ! -z "$MAILER" ]; then if [ ! -z "$MAILER" ]; then
$MAILER "$1" & $MAILER "$1" &
exit 0 exit 0
else
# mozilla derivates may need -remote semantics
for i in thunderbird mozilla netscape; do
mailer=`which $i`
if [ ! -z "$mailer" ]; then
run_mozilla "$mailer" "$1"
exit 0
fi
done
# handle all non mozilla mail clients below
# ..
fi fi
# mozilla derivates may need -remote semantics
for i in thunderbird mozilla netscape; do
mailer=`which $i`
if [ ! -z "$mailer" ]; then
run_mozilla "$mailer" "$1"
exit 0
fi
done
# handle all non mozilla mail clients below
# ..
else else
# check for xdg-open
browser=`which xdg-open`
if [ ! -z "$browser" ]; then
$browser "$1" &
exit 0
fi
# check $BROWSER variable # check $BROWSER variable
if [ ! -z "$BROWSER" ]; then if [ ! -z "$BROWSER" ]; then
$BROWSER "$1" & $BROWSER "$1" &
exit 0 exit 0
else
# mozilla derivates may need -remote semantics
for i in firefox mozilla netscape; do
browser=`which $i`
if [ ! -z "$browser" ]; then
run_mozilla "$browser" "$1"
exit 0
fi
done
# handle all non mozilla browers below
# ..
fi fi
# mozilla derivates may need -remote semantics
for i in firefox mozilla netscape; do
browser=`which $i`
if [ ! -z "$browser" ]; then
run_mozilla "$browser" "$1"
exit 0
fi
done
# handle all non mozilla browers below
# ..
fi fi
exit 1 exit 1