diff options
author | Marcelo Leitner <mrl@mandriva.com> | 2007-03-13 15:08:32 +0000 |
---|---|---|
committer | Marcelo Leitner <mrl@mandriva.com> | 2007-03-13 15:08:32 +0000 |
commit | 20ecf88445e7e0b02ec6a354d416d3c5d6d3c9f6 (patch) | |
tree | 5b430b44a8473e58f46238062fef4bd0377ac9b8 | |
parent | 32f70590e0c50efa72ad5e042b72810efd4ef441 (diff) | |
download | common-data-20ecf88445e7e0b02ec6a354d416d3c5d6d3c9f6.tar common-data-20ecf88445e7e0b02ec6a354d416d3c5d6d3c9f6.tar.gz common-data-20ecf88445e7e0b02ec6a354d416d3c5d6d3c9f6.tar.bz2 common-data-20ecf88445e7e0b02ec6a354d416d3c5d6d3c9f6.tar.xz common-data-20ecf88445e7e0b02ec6a354d416d3c5d6d3c9f6.zip |
- Adds support for newer KDE's
- Adds support for xdg-utils: if an argument is provided, it will be passed
through directly to xdg-open
-rwxr-xr-x | bin/www-browser | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/bin/www-browser b/bin/www-browser index 28e4b1a..38e99ef 100755 --- a/bin/www-browser +++ b/bin/www-browser @@ -9,6 +9,17 @@ # Purpose : launch a web browser #--------------------------------------------------------------- +# +# If we got any argument, we can call xdg-open +# +if [[ -n "$@" ]]; then + exec xdg-open "$@" +fi + +# +# No URL specified, so we must find a proper browser for the current env +# + strip_browser_var() { if [[ -n "$BROWSER" ]]; then if [[ `basename "$BROWSER"` == "www-browser" ]]; then @@ -38,7 +49,8 @@ if [[ -z "$BROWSER" ]]; then NEWBROWSER=`grep -m 1 'BrowserApplication=' $HOME/.kde/share/config/kdeglobals 2>/dev/null` [[ -z "$NEWBROWSER" ]] && NEWBROWSER=`grep -m 1 'BrowserApplication=' /etc/kde/kdeglobals 2>/dev/null` if [[ -n "$NEWBROWSER" ]]; then - BROWSER=`echo $NEWBROWSER | sed -e 's/BrowserApplication=//' -e 's/!//'` + BROWSER=`echo $NEWBROWSER | sed -e 's/BrowserApplication=\(.*\).desktop/\1/'` + BROWSER="dcop klauncher default start_service_by_desktop_name(QString,QStringList) $BROWSER [ ]" fi fi @@ -55,7 +67,7 @@ if [[ -z "$BROWSER" ]]; then fi if [[ -n "$BROWSER" ]]; then - exec $BROWSER "$@" + exec $BROWSER else echo "no web browser detected" fi |