From: Steven Luo Date: Sat, 28 Aug 2010 03:47:29 +0000 (-0700) Subject: Add an Xsession.post script for Fremantle to launch browser-switchboard on session... X-Git-Tag: v3.3b2~7 X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=commitdiff_plain;h=16ad4992d0c5b982f660e8a533f7c37c77c2fdbe;ds=inline Add an Xsession.post script for Fremantle to launch browser-switchboard on session startup Fremantle MicroB autostarts by default and listens on both the D-Bus system and session buses, so applications may send requests on either bus (even though those that send requests on the system bus should be fixed). We therefore need to duplicate this behavior, but we cannot rely on D-Bus to launch us to handle a request coming in on the system bus, since the system bus runs as the "messagebus" user, and we need to run with the UID of the logged-in user. A complete fix for Browser Switchboard bug 5910 ("browser-switchboard should listen on D-Bus system bus as well") on Fremantle therefore requires that browser-switchboard be autostarted when the desktop environment comes up. We arrange for this the same way browserd does on Fremantle -- with an Xsession.post script that runs on X session startup. Also, we prestart MicroB if the current browser-switchboard configuration is to leave it running in the background, to make opening the first MicroB window faster. Because we may start the MicroB browser process, this script needs to be inserted after browserd's in the Xsession.post run order. --- diff --git a/xsession-post.sh b/xsession-post.sh new file mode 100755 index 0000000..237a9cd --- /dev/null +++ b/xsession-post.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# start Browser Switchboard, then start MicroB if appropriate +/usr/bin/browser-switchboard > /dev/null 2>&1 & + +if ! /bin/pidof browser > /dev/null 2>&1; then + DEFAULT_BROWSER=`/usr/bin/browser-switchboard-config -b` + AUTOSTART_MICROB=`/usr/bin/browser-switchboard-config -o autostart_microb` + if [ "$AUTOSTART_MICROB" -eq 1 ] || [ "$DEFAULT_BROWSER" = "microb" -a "$AUTOSTART_MICROB" -ne 0 ]; then + /usr/bin/maemo-invoker /usr/bin/browser.launch > /dev/null 2>&1 & + fi +fi