aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorFrederic Crozat <fcrozat@mandriva.com>2008-08-12 12:48:22 +0000
committerFrederic Crozat <fcrozat@mandriva.com>2008-08-12 12:48:22 +0000
commiteed16ed423be8f9615edb8cd5406e90b491c38dd (patch)
tree89b310a8d7bab4af833b2197c91cb4d1aeb856bd /bin
parentbcfe869376b1385698a1f5aaf2157e26455c7216 (diff)
downloadcommon-data-eed16ed423be8f9615edb8cd5406e90b491c38dd.tar
common-data-eed16ed423be8f9615edb8cd5406e90b491c38dd.tar.gz
common-data-eed16ed423be8f9615edb8cd5406e90b491c38dd.tar.bz2
common-data-eed16ed423be8f9615edb8cd5406e90b491c38dd.tar.xz
common-data-eed16ed423be8f9615edb8cd5406e90b491c38dd.zip
- Add KDE4 detection (Luc Menut)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/www-browser20
1 files changed, 15 insertions, 5 deletions
diff --git a/bin/www-browser b/bin/www-browser
index 4eb6e51..4862616 100755
--- a/bin/www-browser
+++ b/bin/www-browser
@@ -48,21 +48,31 @@ if [[ -z "$BROWSER" ]]; then
#using KDE
if [[ -n "$KDE_FULL_SESSION" ]]; 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`
+ NEWBROWSER=`kreadconfig --group General --key BrowserApplication 2>/dev/null`
if [[ -n "$NEWBROWSER" ]]; then
- BROWSER=`echo $NEWBROWSER | sed -e 's/BrowserApplication=\(.*\).desktop/\1/'`
- BROWSER="dcop klauncher default start_service_by_desktop_name(QString,QStringList) $BROWSER [ ]"
+ BROWSER=`echo $NEWBROWSER | sed -e 's/\(.*\).desktop/\1/'`
+ if [[ x"$KDE_SESSION_VERSION" == x"4" ]]; then # KDE 4
+ BROWSER="dbus-send --type=method_call --dest=org.kde.klauncher /KLauncher org.kde.KLauncher.start_service_by_desktop_name string:$BROWSER array:string: array:string: string: boolean:true"
+ else # KDE 3
+ BROWSER="dcop klauncher default start_service_by_desktop_name(QString,QStringList) $BROWSER [ ]"
+ fi
fi
fi
+ #using XFCE
+ if xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then
+ BROWSER="exo-open --launch WebBrowser"
+ fi
+
+
strip_browser_var
+ [[ -z "$BROWSER" ]] && BROWSER=`which firefox 2> /dev/null`
[[ -z "$BROWSER" ]] && BROWSER=`which mozilla-firefox 2> /dev/null`
[[ -z "$BROWSER" ]] && [[ -n "$KDE_FULL_SESSION" ]] && which kfmclient > /dev/null 2>&1 && BROWSER="kfmclient openProfile webbrowsing"
[[ -z "$BROWSER" ]] && BROWSER=`which epiphany 2> /dev/null`
[[ -z "$BROWSER" ]] && BROWSER=`which galeon 2> /dev/null`
- [[ -z "$BROWSER" ]] && BROWSER=`which mozilla 2> /dev/null`
+ [[ -z "$BROWSER" ]] && BROWSER=`which seamonkey 2> /dev/null`
[[ -z "$BROWSER" ]] && which kfmclient > /dev/null 2>&1 && BROWSER="kfmclient openProfile webbrowsing"
[[ -z "$BROWSER" ]] && which links > /dev/null 2>&1 && BROWSER="xvt -e links"
[[ -z "$BROWSER" ]] && which lynx > /dev/null 2>&1 && BROWSER="xvt -e lynx"