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
Sorry for spam. I've detected a non-POSIX == in the script. Replace it with = please. ;)
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
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.
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.
Created attachment 22449 [details] Wrrrr... another really tiny help bug fixed, this should be the last. I hate when it happens!
Created attachment 22450 [details] Stupid messup, don't ask Sorry for the spam...
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.
Similar functionality has been added to firebird/fox.