Use open on mac

This commit is contained in:
Yevgen Muntyan 2008-05-05 10:17:38 -05:00
parent 6f784d65a9
commit 594b905a8a
3 changed files with 45 additions and 2 deletions

View File

@ -216,6 +216,7 @@ detectDE()
{
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
elif [ x"$MACHTYPE" != x ]; then DE=mac;
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
fi
}
@ -239,6 +240,11 @@ open_gnome()
exec xdg-open "$1"
}
open_mac()
{
exec open "$1"
}
open_xfce()
{
exec xdg-open "$1"
@ -289,6 +295,10 @@ case "$DE" in
open_gnome "$url"
;;
mac)
open_mac "$url"
;;
xfce)
open_xfce "$url"
;;

View File

@ -356,6 +356,7 @@ detectDE()
{
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
elif [ x"$MACHTYPE" != x ]; then DE=mac;
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
fi
}
@ -417,6 +418,17 @@ open_gnome()
}
open_mac()
{
open "$1"
if [ $? -eq 0 ]; then
exit_success
else
exit_failure_operation_failed
fi
}
open_xfce()
{
DEBUG 1 "Running exo-open \"$1\""
@ -598,8 +610,9 @@ mailto=`echo "${mailto}"| sed 's/[?&]$//'`
# Shouldn't happen
[ x"${mailto}" != x"" ] || exit_failure_syntax
if which xdg-email-hook.sh > /dev/null 2> /dev/null; then
xdg-email-hook.sh "${mailto}"
hook=`which xdg-email-hook.sh 2>/dev/null`
if [ -x "$hook" ]; then
"$hook" "${mailto}"
if [ $? -eq 0 ]; then
exit_success
else
@ -626,6 +639,10 @@ case "$DE" in
open_gnome "${mailto}"
;;
mac)
open_mac "${mailto}"
;;
xfce)
open_xfce "${mailto}"
;;

View File

@ -303,6 +303,7 @@ detectDE()
{
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
elif [ x"$MACHTYPE" != x ]; then DE=mac;
elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
fi
}
@ -347,6 +348,17 @@ open_gnome()
fi
}
open_mac()
{
open "$1"
if [ $? -eq 0 ]; then
exit_success
else
exit_failure_operation_failed
fi
}
open_xfce()
{
exo-open "$1"
@ -422,6 +434,10 @@ case "$DE" in
open_gnome "$url"
;;
mac)
open_mac "$url"
;;
xfce)
open_xfce "$url"
;;