Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 35479 - Better MozillaFirebird startup script [included]
Summary: Better MozillaFirebird startup script [included]
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-09 13:58 UTC by Radoslaw Szkodzinski
Modified: 2004-02-15 09:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Final version of the script (MozillaFirebird,1.99 KB, text/plain)
2003-12-19 13:08 UTC, Radoslaw Szkodzinski
Details
Fixed script, now works as advertised (MozillaFirebird,6.49 KB, text/plain)
2003-12-19 15:27 UTC, Radoslaw Szkodzinski
Details
Wrrrr... another really tiny help bug fixed, this should be the last. (MozillaFirebird,6.50 KB, text/plain)
2003-12-19 15:29 UTC, Radoslaw Szkodzinski
Details
Stupid messup, don't ask (MozillaFirebird,6.50 KB, text/plain)
2003-12-19 15:35 UTC, Radoslaw Szkodzinski
Details
Startup script with additional handling of command line options. (MozillaFirebird,1.97 KB, text/plain)
2004-01-03 14:40 UTC, Zach Forrest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Radoslaw Szkodzinski 2003-12-09 13:58:06 UTC
This scipt allows one to use commandline parameters
and optionally open new URLs in tabs. (a note about this should be in ebuilds)

--
#!/bin/sh

# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: $

# This is the Gentoo Mozilla Firebird startup script
# Additions, suggestions?
# contact phoen][x <phoenix@gentoo.org> or AstralStorm <astralstorm@gorzow.mm.pl>

# Open new urls in tabs instead of new windows if 1
#TABS=1

export MOZILLA_FIVE_HOME="/usr/lib/MozillaFirebird"
FIREBIRD_PATH="/usr/lib/MozillaFirebird"

if [[ ${1:0:1} == "-" || -z "`/bin/ps x | /bin/grep \"[0-9] ${FIREBIRD_PATH}/MozillaFirebird-bin\"`" ]]; then
    # Parameters given or no MozillaFirebird running
    ${FIREBIRD_PATH}/MozillaFirebird $@
else
    if [[ -z $@ ]]; then
        # No parameters - create new window
        ${FIREBIRD_PATH}/MozillaFirebird -remote "openURL(,new-window)"
    else
        if [[ $TABS = 1 ]]; then
            # Open a new tab
            ${FIREBIRD_PATH}/MozillaFirebird -remote "openURL($@ ,new-tab)"
        else
            # Open a new window
            ${FIREBIRD_PATH}/MozillaFirebird -remote "openURL($@ ,new-window)"
        fi
    fi
fi
Comment 1 Radoslaw Szkodzinski 2003-12-09 14:01:12 UTC
Sorry for spam. I've detected a non-POSIX == in the script.
Replace it with = please. ;)
Comment 2 Radoslaw Szkodzinski 2003-12-09 14:34:00 UTC
Slight cleanup and speedup.

--
#!/bin/sh

# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: $

# This is the Gentoo Mozilla Firebird startup script
# Additions, suggestions?
# contact phoen][x <phoenix@gentoo.org> or AstralStorm <astralstorm@gorzow.mm.pl>

# Open new urls in tabs instead of new windows if 1
#TABS=1

export MOZILLA_FIVE_HOME="/usr/lib/MozillaFirebird"
FIREBIRD_PATH="/usr/lib/MozillaFirebird"

# Commandline parameter decoding

if [[ ${1:0:1} = "-" || -z "`/bin/ps x | /bin/grep \"[0-9] ${FIREBIRD_PATH}/MozillaFirebird-bin\"`" ]]; then
    # No MozillaFirebird running or parameters given
    ${FIREBIRD_PATH}/MozillaFirebird $@
else
    if [[ $TABS != 1 || -z $@ ]]; then
        # No parameters - create new window
        ${FIREBIRD_PATH}/MozillaFirebird -remote "openURL($@,new-window)"
    else
        # Open a new tab
        ${FIREBIRD_PATH}/MozillaFirebird -remote "openURL($@,new-tab)"
    fi
fi
Comment 3 Radoslaw Szkodzinski 2003-12-19 13:08:13 UTC
Created attachment 22444 [details]
Final version of the script

I've updated the script to allow forcing of opening in either tabs or windows 
of ANY number of URLs, unlike the original one by phoen][x,
which can open only one URL if Firebird is already started.
Comment 4 Radoslaw Szkodzinski 2003-12-19 15:27:14 UTC
Created attachment 22448 [details]
Fixed script, now works as advertised

The previous script was buggy. This is the fixed, ugly version.
If somebody could modularise it, I'd be grateful. ;)

This version requires screen for opening multiple URLs from command line, but
it can work w/o it.
Comment 5 Radoslaw Szkodzinski 2003-12-19 15:29:08 UTC
Created attachment 22449 [details]
Wrrrr... another really tiny help bug fixed, this should be the last.

I hate when it happens!
Comment 6 Radoslaw Szkodzinski 2003-12-19 15:35:10 UTC
Created attachment 22450 [details]
Stupid messup, don't ask

Sorry for the spam...
Comment 7 Zach Forrest 2004-01-03 14:40:24 UTC
Created attachment 23102 [details]
Startup script with additional handling of command line options.

This startup script handles the different profile related command line options
as well as the help command line option. I didn't factor in the additions from
the other posted attachments, but it shouldn't be too difficult to make the
necessary changes.
Comment 8 Brad Laue (RETIRED) gentoo-dev 2004-02-15 09:37:07 UTC
Similar functionality has been added to firebird/fox.