#!/bin/sh VERSION="1.1" ############################################################################### # webnewtab - Open the URL given on the command line in a new Firefox tab # # Written to be invoked by software that likes to run 'firefox %s'; ie: # /usr/local/bin/webnewtab '%s' # Works across multiple displays (well, :0.0 and :0.1). # # Written by Tim Skirvin . Copyright 2002-2006. # Licensed under the UIUC/NCSA Open Source License: # # http://www.ks.uiuc.edu/Development/MDTools/scripts/license.html # ############################################################################### # DISPLAY=":0.0" # export DISPLAY LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib/firefox"; export LD_LIBRARY_PATH CHECK="/usr/local/lib/firefox/mozilla-xremote-client -a firefox" PHOE="/usr/local/bin/firefox" URL="$@" DISP2=`echo $DISPLAY | sed -e 's/\.1/\.0/g'` # echo "$DISP2 openURL($URL,new-tab)" >> /home/tskirvin/testing for i in $DISPLAY $DISP2 :0.0 :0.1 do DISPLAY=$i export DISPLAY $CHECK "ping()" 2>/dev/null >/dev/null if [ $? = 0 ] ; then exec $CHECK "openURL($URL,new-tab)" fi done $PHOE $URL & ############################################################################### ### Version History ########################################################### ############################################################################### # 1.1 Thu 09 Feb 10:36:27 CST 2006 tskirvin ### Added version history, and made debugging a bit easier, but no other major ### changes. # 1.0 Tue 31 Jan 16:47:03 CST 2006 tskirvin ### First version ready for web in in any way.