Index: scripts/xdg-email =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-email,v retrieving revision 1.37 diff -u -r1.37 xdg-email --- scripts/xdg-email 24 Jan 2008 20:24:50 -0000 1.37 +++ scripts/xdg-email 26 Apr 2008 12:27:44 -0000 @@ -356,6 +356,7 @@ { if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; + elif [ x"$BE_HOST_CPU" != x"" ]; then DE=beos; elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; fi } @@ -429,6 +430,31 @@ fi } +open_beos() +{ + DEBUG 1 "Running beos-open \"$1\"" + if [ "$(setmime -dump text/x-email | grep application/x-vnd.Be-MAIL)" = "" ]; then + # not using BeMail, just let registrar call the prefered app and hope it handles it + /bin/open "$1" + else + # BeMail has its own args + for app in /boot/beos/apps/Mail /boot/apps/Internet/BeMail /boot/beos/apps/BeMail; do + test -x $app && break + done + test -x "$app" || exit_failure_operation_impossible + # xargs doesn't like multiline stuff... we have to do that to unescape urls but that's a bit dangerous. + builtin echo -ne "$app " "`echo "$1" | tr '&?' '\n\n' | \ + sed 's/^to=/mailto:/;s/^cc=/ccto:/;s/^bcc=/bccto:/;s/^subject=\(.*\)/-subject "\1"/;s/body=\(.*\)/-body "\1"/;s/^attach=\(.*\)/"enclosure:\1"/;' | \ + sed 's/%22/\\\\"/g;s/%0D//g;s/%/\\\x/g;s/$/ /' | sed 's/$/\\\\/' `" | /bin/sh + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + open_generic() { IFS=":" @@ -631,6 +657,10 @@ open_xfce "${mailto}" ;; + beos) + open_beos "${mailto}" + ;; + generic) open_generic "${mailto}" ;; Index: scripts/xdg-email.in =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-email.in,v retrieving revision 1.25 diff -u -r1.25 xdg-email.in --- scripts/xdg-email.in 24 Jan 2008 20:24:50 -0000 1.25 +++ scripts/xdg-email.in 26 Apr 2008 12:27:44 -0000 @@ -80,6 +80,31 @@ fi } +open_beos() +{ + DEBUG 1 "Running beos-open \"$1\"" + if [ "$(setmime -dump text/x-email | grep application/x-vnd.Be-MAIL)" = "" ]; then + # not using BeMail, just let registrar call the prefered app and hope it handles it + /bin/open "$1" + else + # BeMail has its own args + for app in /boot/beos/apps/Mail /boot/apps/Internet/BeMail /boot/beos/apps/BeMail; do + test -x $app && break + done + test -x "$app" || exit_failure_operation_impossible + # xargs doesn't like multiline stuff... we have to do that to unescape urls but that's a bit dangerous. + builtin echo -ne "$app " "`echo "$1" | tr '&?' '\n\n' | \ + sed 's/^to=/mailto:/;s/^cc=/ccto:/;s/^bcc=/bccto:/;s/^subject=\(.*\)/-subject "\1"/;s/body=\(.*\)/-body "\1"/;s/^attach=\(.*\)/"enclosure:\1"/;' | \ + sed 's/%22/\\\\"/g;s/%0D//g;s/%/\\\x/g;s/$/ /' | sed 's/$/\\\\/' `" | /bin/sh + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + open_generic() { IFS=":" Index: scripts/xdg-file-dialog =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-file-dialog,v retrieving revision 1.12 diff -u -r1.12 xdg-file-dialog --- scripts/xdg-file-dialog 15 Jun 2006 00:44:19 -0000 1.12 +++ scripts/xdg-file-dialog 26 Apr 2008 12:27:44 -0000 @@ -259,6 +259,7 @@ { if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; + elif [ x"$BE_HOST_CPU" != x"" ]; then DE=beos HASX11=no; elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; fi } @@ -323,6 +324,39 @@ fi } +open_beos() +{ + FILEPANEL=/bin/filepanel + if [ -x $FILEPANEL ]; then + if [ x"$1" != x"" ]; then + FOLDER=`dirname "$1"` + FILENAME=`basename "$1"` + fi + + if [ x"$FILENAME" != x"" ]; then + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --single --kind fs --default "$FILENAME" + else + $FILEPANEL --load --single --kind fs --default "$FILENAME" + fi + else + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --single --kind fs + else + $FILEPANEL --load --single --kind fs + fi + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi + else + exit_failure_operation_impossible + fi +} + open_multi_kde() { DIALOG=`which kdialog` @@ -381,6 +415,39 @@ fi } +open_multi_beos() +{ + FILEPANEL=/bin/filepanel + if [ -x $FILEPANEL ]; then + if [ x"$1" != x"" ]; then + FOLDER=`dirname "$1"` + FILENAME=`basename "$1"` + fi + + if [ x"$FILENAME" != x"" ]; then + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --kind fs --default "$FILENAME" + else + $FILEPANEL --load --kind fs --default "$FILENAME" + fi + else + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --kind fs + else + $FILEPANEL --load --kind fs + fi + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi + else + exit_failure_operation_impossible + fi +} + save_kde() { DIALOG=`which kdialog` @@ -437,6 +504,39 @@ fi } +save_beos() +{ + FILEPANEL=/bin/filepanel + if [ -x $FILEPANEL ]; then + if [ x"$1" != x"" ]; then + FOLDER=`dirname "$1"` + FILENAME=`basename "$1"` + fi + + if [ x"$FILENAME" != x"" ]; then + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --save --single --kind fs --default "$FILENAME" + else + $FILEPANEL --save --single --kind fs --default "$FILENAME" + fi + else + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --save --single --kind fs + else + $FILEPANEL --save --single --kind fs + fi + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi + else + exit_failure_operation_impossible + fi +} + directory_kde() { DIALOG=`which kdialog` @@ -481,6 +581,39 @@ fi } +directory_beos() +{ + FILEPANEL=/bin/filepanel + if [ -x $FILEPANEL ]; then + if [ x"$1" != x"" ]; then + FOLDER=`dirname "$1"` + FILENAME=`basename "$1"` + fi + + if [ x"$FILENAME" != x"" ]; then + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --single --kind d --default "$FILENAME" + else + $FILEPANEL --load --single --kind d "$FILENAME" + fi + else + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --single --kind d + else + $FILEPANEL --load --single --kind d + fi + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi + else + exit_failure_operation_impossible + fi +} + [ x"$1" != x"" ] || exit_failure_syntax TITLE= @@ -554,6 +687,10 @@ open_zenity "$filename" ;; + beos) + open_beos "$filename" + ;; + *) exit_failure_operation_impossible "no method available for opening a filename dialog" ;; @@ -568,6 +705,10 @@ open_multi_zenity "$filename" ;; + beos) + open_multi_beos "$filename" + ;; + *) exit_failure_operation_impossible "no method available for opening a filename dialog" ;; @@ -582,6 +723,10 @@ save_zenity "$filename" ;; + beos) + save_beos "$filename" + ;; + *) exit_failure_operation_impossible "no method available for opening a filename dialog" ;; @@ -596,6 +741,10 @@ directory_zenity "$filename" ;; + beos) + directory_beos "$filename" + ;; + *) exit_failure_operation_impossible "no method available for opening a directory dialog" ;; Index: scripts/xdg-file-dialog.in =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-file-dialog.in,v retrieving revision 1.10 diff -u -r1.10 xdg-file-dialog.in --- scripts/xdg-file-dialog.in 25 Jul 2006 00:44:02 -0000 1.10 +++ scripts/xdg-file-dialog.in 26 Apr 2008 12:27:44 -0000 @@ -83,6 +83,39 @@ fi } +open_beos() +{ + FILEPANEL=/bin/filepanel + if [ -x $FILEPANEL ]; then + if [ x"$1" != x"" ]; then + FOLDER=`dirname "$1"` + FILENAME=`basename "$1"` + fi + + if [ x"$FILENAME" != x"" ]; then + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --single --kind fs --default "$FILENAME" + else + $FILEPANEL --load --single --kind fs --default "$FILENAME" + fi + else + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --single --kind fs + else + $FILEPANEL --load --single --kind fs + fi + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi + else + exit_failure_operation_impossible + fi +} + open_multi_kde() { DIALOG=`which kdialog` @@ -141,6 +174,39 @@ fi } +open_multi_beos() +{ + FILEPANEL=/bin/filepanel + if [ -x $FILEPANEL ]; then + if [ x"$1" != x"" ]; then + FOLDER=`dirname "$1"` + FILENAME=`basename "$1"` + fi + + if [ x"$FILENAME" != x"" ]; then + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --kind fs --default "$FILENAME" + else + $FILEPANEL --load --kind fs --default "$FILENAME" + fi + else + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --kind fs + else + $FILEPANEL --load --kind fs + fi + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi + else + exit_failure_operation_impossible + fi +} + save_kde() { DIALOG=`which kdialog` @@ -197,6 +263,39 @@ fi } +save_beos() +{ + FILEPANEL=/bin/filepanel + if [ -x $FILEPANEL ]; then + if [ x"$1" != x"" ]; then + FOLDER=`dirname "$1"` + FILENAME=`basename "$1"` + fi + + if [ x"$FILENAME" != x"" ]; then + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --save --single --kind fs --default "$FILENAME" + else + $FILEPANEL --save --single --kind fs --default "$FILENAME" + fi + else + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --save --single --kind fs + else + $FILEPANEL --save --single --kind fs + fi + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi + else + exit_failure_operation_impossible + fi +} + directory_kde() { DIALOG=`which kdialog` @@ -241,6 +340,39 @@ fi } +directory_beos() +{ + FILEPANEL=/bin/filepanel + if [ -x $FILEPANEL ]; then + if [ x"$1" != x"" ]; then + FOLDER=`dirname "$1"` + FILENAME=`basename "$1"` + fi + + if [ x"$FILENAME" != x"" ]; then + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --single --kind d --default "$FILENAME" + else + $FILEPANEL --load --single --kind d "$FILENAME" + fi + else + if [ x"$TITLE" != x"" ]; then + $FILEPANEL --title "$TITLE" --load --single --kind d + else + $FILEPANEL --load --single --kind d + fi + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi + else + exit_failure_operation_impossible + fi +} + [ x"$1" != x"" ] || exit_failure_syntax TITLE= @@ -314,6 +446,10 @@ open_zenity "$filename" ;; + beos) + open_beos "$filename" + ;; + *) exit_failure_operation_impossible "no method available for opening a filename dialog" ;; @@ -328,6 +464,10 @@ open_multi_zenity "$filename" ;; + beos) + open_multi_beos "$filename" + ;; + *) exit_failure_operation_impossible "no method available for opening a filename dialog" ;; @@ -342,6 +482,10 @@ save_zenity "$filename" ;; + beos) + save_beos "$filename" + ;; + *) exit_failure_operation_impossible "no method available for opening a filename dialog" ;; @@ -356,6 +500,10 @@ directory_zenity "$filename" ;; + beos) + directory_beos "$filename" + ;; + *) exit_failure_operation_impossible "no method available for opening a directory dialog" ;; Index: scripts/xdg-open =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-open,v retrieving revision 1.33 diff -u -r1.33 xdg-open --- scripts/xdg-open 24 Jan 2008 20:24:51 -0000 1.33 +++ scripts/xdg-open 26 Apr 2008 12:27:45 -0000 @@ -303,6 +303,7 @@ { if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; + elif [ x"$BE_HOST_CPU" != x"" ]; then DE=beos; elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; fi } @@ -358,6 +359,18 @@ fi } +# BeOS/Zeta/Haiku +open_beos() +{ + open "$1" + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + open_generic() { if mimeopen -v 2>/dev/null 1>&2; then @@ -445,6 +458,10 @@ open_xfce "$url" ;; + beos) + open_beos "$url" + ;; + generic) open_generic "$url" ;; Index: scripts/xdg-open.in =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-open.in,v retrieving revision 1.18 diff -u -r1.18 xdg-open.in --- scripts/xdg-open.in 24 Jan 2008 20:24:51 -0000 1.18 +++ scripts/xdg-open.in 26 Apr 2008 12:27:45 -0000 @@ -61,6 +61,18 @@ fi } +# BeOS/Zeta/Haiku +open_beos() +{ + /bin/open "$1" + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + open_generic() { if mimeopen -v 2>/dev/null 1>&2; then @@ -148,6 +160,10 @@ open_xfce "$url" ;; + beos) + open_beos "$url" + ;; + generic) open_generic "$url" ;; Index: scripts/xdg-screensaver =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-screensaver,v retrieving revision 1.36 diff -u -r1.36 xdg-screensaver --- scripts/xdg-screensaver 24 Jun 2007 22:52:22 -0000 1.36 +++ scripts/xdg-screensaver 26 Apr 2008 12:27:45 -0000 @@ -333,6 +333,7 @@ { if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; + elif [ x"$BE_HOST_CPU" != x"" ]; then DE=beos; elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; fi } @@ -398,7 +399,7 @@ { result=1 - if [ "$1" = "resume" ] ; then + if [ "$DE" != "beos" -a "$1" = "resume" ] ; then # Restore DPMS state if [ -f "$screensaver_file.dpms" ]; then rm "$screensaver_file.dpms" @@ -406,7 +407,7 @@ xset +dpms fi fi - if [ "$1" = "reset" ] ; then + if [ "$DE" != "beos" -a "$1" = "reset" ] ; then if xset -q | grep 'DPMS is Enabled' > /dev/null 2> /dev/null; then xset dpms force on fi @@ -424,9 +425,13 @@ xscreensaver) screensaver_xscreensaver "$1" ;; + + beos) + screensaver_beos "$1" + ;; esac - if [ "$1" = "suspend" ] ; then + if [ "$DE" != "beos" -a "$1" = "suspend" ] ; then # Save DPMS state if xset -q | grep 'DPMS is Enabled' > /dev/null 2> /dev/null; then test "${TMPDIR+set}" = set || TMPDIR=/tmp @@ -710,6 +715,48 @@ esac } +screensaver_beos() +{ + case "$1" in + suspend) + # unimplemented + result=0 + ;; + + resume) + # unimplemented + result=0 + ;; + + activate) + screen_blanker > /dev/null 2> /dev/null & + result=$? + ;; + + lock) + # should lock + screen_blanker > /dev/null 2> /dev/null & + result=$? + ;; + + reset) + # Turns the screensaver off right now + quit application/x-vnd.Be.screenblanker > /dev/null 2> /dev/null + result=$? + ;; + + status) + result=0 + echo "enabled" + ;; + + *) + echo "ERROR: Unknown command '$1" >&2 + return 1 + ;; + esac +} + [ x"$1" != x"" ] || exit_failure_syntax action= Index: scripts/xdg-screensaver.in =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-screensaver.in,v retrieving revision 1.24 diff -u -r1.24 xdg-screensaver.in --- scripts/xdg-screensaver.in 24 Jun 2007 22:52:22 -0000 1.24 +++ scripts/xdg-screensaver.in 26 Apr 2008 12:27:45 -0000 @@ -70,7 +70,7 @@ { result=1 - if [ "$1" = "resume" ] ; then + if [ "$HASX11" = "yes" -a "$1" = "resume" ] ; then # Restore DPMS state if [ -f "$screensaver_file.dpms" ]; then rm "$screensaver_file.dpms" @@ -78,7 +78,7 @@ xset +dpms fi fi - if [ "$1" = "reset" ] ; then + if [ "$HASX11" = "yes" -a "$1" = "reset" ] ; then if xset -q | grep 'DPMS is Enabled' > /dev/null 2> /dev/null; then xset dpms force on fi @@ -382,6 +382,48 @@ esac } +screensaver_beos() +{ + case "$1" in + suspend) + # unimplemented + result=0 + ;; + + resume) + # unimplemented + result=0 + ;; + + activate) + /bin/screen_blanker > /dev/null 2> /dev/null & + result=$? + ;; + + lock) + # should lock + /bin/screen_blanker > /dev/null 2> /dev/null & + result=$? + ;; + + reset) + # Turns the screensaver off right now + /bin/quit application/x-vnd.Be.screenblanker > /dev/null 2> /dev/null + result=$? + ;; + + status) + result=0 + echo "enabled" + ;; + + *) + echo "ERROR: Unknown command '$1" >&2 + return 1 + ;; + esac +} + [ x"$1" != x"" ] || exit_failure_syntax action= Index: scripts/xdg-terminal =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-terminal,v retrieving revision 1.3 diff -u -r1.3 xdg-terminal --- scripts/xdg-terminal 7 Dec 2006 19:30:43 -0000 1.3 +++ scripts/xdg-terminal 26 Apr 2008 12:27:45 -0000 @@ -298,6 +298,7 @@ { if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; + elif [ x"$BE_HOST_CPU" != x"" ]; then DE=beos HASX11=no; elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; fi } @@ -388,6 +389,21 @@ fi } +terminal_beos() +{ + if [ x"$1" == x"" ]; then + Terminal & + else + Terminal -c /bin/sh -c "$1" & + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + terminal_generic() { # if $TERM is not set, try xterm @@ -452,6 +468,10 @@ terminal_xfce "$command" ;; + beos) + terminal_beos "$command" + ;; + generic) terminal_generic "$command" ;; Index: scripts/xdg-terminal.in =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-terminal.in,v retrieving revision 1.3 diff -u -r1.3 xdg-terminal.in --- scripts/xdg-terminal.in 7 Dec 2006 19:30:43 -0000 1.3 +++ scripts/xdg-terminal.in 26 Apr 2008 12:27:45 -0000 @@ -95,6 +95,21 @@ fi } +terminal_beos() +{ + if [ x"$1" == x"" ]; then + Terminal & + else + Terminal -c /bin/sh -c "$1" & + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + terminal_generic() { # if $TERM is not set, try xterm @@ -159,6 +174,10 @@ terminal_xfce "$command" ;; + beos) + terminal_beos "$command" + ;; + generic) terminal_generic "$command" ;; Index: scripts/xdg-utils-common.in =================================================================== RCS file: /cvs/portland/portland/xdg-utils/scripts/xdg-utils-common.in,v retrieving revision 1.23 diff -u -r1.23 xdg-utils-common.in --- scripts/xdg-utils-common.in 4 Nov 2006 06:23:49 -0000 1.23 +++ scripts/xdg-utils-common.in 26 Apr 2008 12:27:46 -0000 @@ -193,8 +193,10 @@ detectDE() { + HASX11=yes if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; + elif [ x"$BE_HOST_CPU" != x"" ]; then DE=beos HASX11=no; elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; fi }