diff options
author | Aron Griffis <agriffis@gentoo.org> | 2004-01-14 20:50:49 +0000 |
---|---|---|
committer | Aron Griffis <agriffis@gentoo.org> | 2004-01-14 20:50:49 +0000 |
commit | 14a38136a506d36ed571d264156a7ac362b4feb2 (patch) | |
tree | 818eab54b8ec08e21d8d029f131a5a375db24300 /net-www/mozilla-firebird | |
parent | stable on hppa (diff) | |
download | gentoo-2-14a38136a506d36ed571d264156a7ac362b4feb2.tar.gz gentoo-2-14a38136a506d36ed571d264156a7ac362b4feb2.tar.bz2 gentoo-2-14a38136a506d36ed571d264156a7ac362b4feb2.zip |
Use more powerful MozillaFirebird startup script from bug 38102. Not doing a rev-bump since it's not really necessary to make everybody rebuild for this
Diffstat (limited to 'net-www/mozilla-firebird')
-rw-r--r-- | net-www/mozilla-firebird/ChangeLog | 8 | ||||
-rw-r--r-- | net-www/mozilla-firebird/files/MozillaFirebird | 81 |
2 files changed, 74 insertions, 15 deletions
diff --git a/net-www/mozilla-firebird/ChangeLog b/net-www/mozilla-firebird/ChangeLog index c617ce726b5d..58c86ccc02f4 100644 --- a/net-www/mozilla-firebird/ChangeLog +++ b/net-www/mozilla-firebird/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-www/mozilla-firebird -# Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-www/mozilla-firebird/ChangeLog,v 1.31 2003/12/25 01:55:29 bazik Exp $ +# Copyright 2000-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-www/mozilla-firebird/ChangeLog,v 1.32 2004/01/14 20:50:49 agriffis Exp $ + + 14 Jan 2004; Aron Griffis <agriffis@gentoo.org> files/MozillaFirebird: + Use more powerful MozillaFirebird startup script from bug 38102. Not doing a + rev-bump since it's not really necessary to make everybody rebuild for this 25 Dec 2003; Sven Blumenstein <bazik@gentoo.org> mozilla-firebird-0.7-r1.ebuild: diff --git a/net-www/mozilla-firebird/files/MozillaFirebird b/net-www/mozilla-firebird/files/MozillaFirebird index 6e5054da0eb6..3f8c2f6ecbc1 100644 --- a/net-www/mozilla-firebird/files/MozillaFirebird +++ b/net-www/mozilla-firebird/files/MozillaFirebird @@ -1,20 +1,75 @@ -#!/bin/sh - -# Copyright 1999-2003 Gentoo Technologies, Inc. +#!/bin/bash +# +# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-www/mozilla-firebird/files/MozillaFirebird,v 1.1 2003/06/02 21:40:42 brad Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-www/mozilla-firebird/files/MozillaFirebird,v 1.2 2004/01/14 20:50:49 agriffis Exp $ -# This is the Gentoo Phoenix startup script -# Additions, suggestions? -# contact phoen][x <phoenix@gentoo.org> +# Set to "window" if you prefer new Firebird windows instead of new tabs +newtype=${MOZILLA_NEWTYPE:-"tab"} +# Point this to your Firebird installation if not using the default export MOZILLA_FIVE_HOME="/usr/lib/MozillaFirebird" -FIREBIRD_PATH="/usr/lib/MozillaFirebird" +fbpath=${MOZILLA_FIVE_HOME} + +# Sanity check +if [[ -z $DISPLAY ]]; then + echo "DISPLAY is unset!" >&2 + exit 1 +fi + +# Validate the args and extract the url +url='' +declare -a args=($@) +while [[ $# -ne 0 ]] ; do + if [[ $1 == -* ]] ; then + case ${1#-} in + height|width|CreateProfile|P|UILocale|contentLocale|remote|edit|chrome) + shift 2 ;; + *) + shift 1 ;; + esac + else + if [[ -n $url ]] ; then + echo "Usage error: more than one URL given" >&2 + exit 255 + else + url=$1 + shift 1 + if [[ $url != *:* ]] ; then + url=http://$url + fi + fi + fi +done -if [ -z "`/bin/ps x | /bin/grep \"[0-9] ${FIREBIRD_PATH}/MozillaFirebird-bin\"`" ]; then - # No MozillaFirebird running - ${FIREBIRD_PATH}/MozillaFirebird $@ +# Try to start in an existing session; check all screens +declare -a screens=( + $(xdpyinfo | awk ' + /^name of display:/ { + disp = substr($NF, 0, index($NF, ".")-1) + } + /^number of screens:/ { + for (i = 0; i < $NF; i++) printf("%s.%d\n", disp, i) + }') + ) +for s in $DISPLAY "${screens[@]}"; do + DISPLAY=${s} ${fbpath}/mozilla-xremote-client "openURL($url, new-$newtype)" \ + && exit 0 +done +retval=$? + +if [[ $retval -eq 2 ]] ; then + # No running windows found, so start a new instance + ${fbpath}/MozillaFirebird "${args[@]}" + retval=$? +elif [[ $retval -eq 1 ]] ; then + echo "Unable to connect to X server" >&2 +elif [[ $retval -eq 3 ]] ; then + echo "Unable to send command to running Mozilla Firebird instance" >&2 else - # MozillaFirebird running - open a new window - ${FIREBIRD_PATH}/MozillaFirebird -remote "openURL($@ ,new-window)" + echo "Unknown error $retval from mozilla-xremote-client" >&2 fi + +exit $retval + +# vim:expandtab sw=2: |