My Location Message Board E-Mail
pcbypaul
pc software, repair
      return to
    Homepage
bg

 
WP Clipart

Not Just for Geeks Anymore
Scripts 'N Tips
Xterm Use
Firefox Updating
update Java
Firefox Keys
Themes offline
Start Firefox
Kill Firefox
Firefox 16x16
Firefox Problems
Compiling
Compile wxPython
Disk Usage
CD Player
cdArray
Find-Installed
Backgrounds
Gimp Splash
Links
LinuxPackages
IceWalkers
Freshmeat
Linux Today
Slashdot



Scripts for Firefox

To start, run a splash screen, or close cleanly if frozen.


First, I use a couple scripts to start Firefox. The first is pretty common except that it fires up a splash screen if Firefox was not open yet. Normally I'm not a fan of slashscreen fanfare, but Firefox does take several seconds to load, and I use Sylpheed for mail. So when I open links I'd kind of like to know if I might NOT have properly double-clicked on a link in my email, without sitting there waiting for nothing . . . (You Sylpheed users know what I'm talking about.)
And some folks just like splasscreens. So here goes --

You need Firefox, XV and an image to use for a splash.
[You probably have xv already, type "which xv" in an xterm if unsure.]
That and the two small scripts below. "firefox.sh" and "ffsplash.sh"
Don't forget to make then executable.
I also symlink firefox.sh to "mozilla" -- that saves a lot of effort down the road.


firefox.sh

#!/bin/sh
# Written by Robert Mullenix, June 2004
# reworked and personalized by Paul Sherman 
# currently running with firefox-1.0.2
# also connect it to another script which runs a splash screen
# which I find especially useful when calling Firefox from Sylpheed.

MOZILLA="/usr/bin/firefox"
home="http://www.google.com"
# first, correct the path if one is passed
if [ "$1" != "" ]
	then
		if [ "`expr substr "$1" 1 1`" = "/" ]
			then
				FILE_PATH="file://$1"
			else
				FILE_PATH="$1"
		fi
fi
FILE_PATH=${FILE_PATH//" "/"%20"}
# Find out Firefox is open already
if $MOZILLA -a firefox -remote "ping()" 2>/dev/null
then
  if [ -z $1 ]
  then
# instance already opened, no url passed, open new tab
    $MOZILLA -a firefox -remote "openURL($home,new-tab)" &
  else
# instance already opened, launch URL $1 in new tab
    $MOZILLA -a firefox -remote "openURL($FILE_PATH,new-tab)" &
  fi
else
  ffSplash.sh &
  if [ -z $1 ]
  then
#  no URL present, just open firefox
    $MOZILLA &
  else
#  no instances exist, open a new window with URL $1
    $MOZILLA $1 &
  fi
fi
exit 1 



ffsplash.sh


#!/bin/sh
#
# ffSplash.sh
# uses xv for a splash screen for Firefox
# 2005 by Paul Sherman 

height=$(echo  $(xwininfo  -root  |  \
      awk  'BEGIN  {FS=":"}  /Height/  {print $2}'))
width=$(echo  $(xwininfo  -root  |  \
      awk  'BEGIN  {FS=":"}  /Width/  {print $2}'))
	  
mleft=$[($width-400)/2]
mtop=$[($height-300)/2]

xv -nodecor -cursor 150 -viewonly -geometry +$mleft+$mtop /usr/share/pixmaps/ffSplash2.png &
pid=$!
sleep 3
kill -kill $pid
exit 0

Here is my splash. But use your imagination!





As you can see I left "white space" to customize. (Might as well lead others to believe you know what you are doing, eh?)

Tux Pages created and served by Linux Graphics made/edited by the Gimp   Created with the Gimp byPaul