You are not logged in.
Aha, seems the icons moved. Open the script and go to the line where SOURCEBASE is defined. Replace "lxr" with "mxr", so that it reads http://mxr.mozilla.org/seamonkey/source instead of http://lxr.mozilla.org/seamonkey/source
Offline
wget would follow the redirection. Why not use it instead of curl?
Just thinking...
Offline
Just add the -L option to curl and it would do the same.
Offline
Thats nice!
Thanks
Offline
Why use curl to begin with? wget is installed by default, curl is not.
[git] | [AURpkgs] | [arch-games]
Offline
Don't remember really - I believe I started using curl instead of wget since I liked the output from curl better (stdout, stderr, error messages and so on).
Offline
Might be better for this script to use wget though. Same functionality for this use, but less deps.
[git] | [AURpkgs] | [arch-games]
Offline
Feel free to replace it.
Offline
Oh, I also wanted to note that your script it set for #!/bin/sh, but you use bash syntax. If a user has a non-bash shell for sh, it will break.
[git] | [AURpkgs] | [arch-games]
Offline
Thank you. Its nice to see the Firefox logo. The script works!
Offline
Here's an updated version of the firebrand script for anyone that might be interested:
#!/bin/sh
#
# firebrand - a script to brand firefox without recompilation
#
#
# This script replaces and changes (a few) files in an existing firefox
# installation. Run it after a firefox installation or upgrade, and restart
# firefox. The program icon may not be (visibly) replaced until your desktop
# environment is restarted.
#
# To revert to the original brand, simply reinstall firefox.
#
# Dependencies: curl, zip, unzip, imagemagick
#
#FIREFOXDIR: Where firefox's data files resides.
# Gran Paradiso:
FIREFOXDIR=/usr/lib/firefox-3.0
FIREFOXSTRING="Gran Paradiso"
FIREFOXSTRINGPREFS="GranParadiso"
NEWICONSDIR="" # If empty, the script uses a temporary directory for the replacement icons.
# If you want to avoid downloading the icons every time you rebrand firefox,
# point NEWICONSDIR to a suitable directory.
SOURCEBASE="http://mxr.mozilla.org/seamonkey/source" # The URL under which the "other-licenses" directory resides.
CHROMEDIR=$FIREFOXDIR/chrome # Simply the firefox chrome directory.
die() {
EXITCODE="${1:-9}"
MESSAGE="$2"
echo -e "\n$MESSAGE"
exit $EXITCODE
}
get_icon() {
local ICON="$1"
local SOURCEFILE="$2"
echo -n " - $ICON"
if [ -e "$NEWICONSDIR/$ICON" ] ; then
if [ -f "$NEWICONSDIR/$ICON" ] ; then
echo " is present."
return 0
else
echo " is present but is not a file. Quitting."
exit 1
fi
fi
echo -n ": Downloading... "
if curl -sS "${SOURCEBASE}${SOURCEFILE}" > "$NEWICONSDIR/$ICON" ; then
echo "Done."
return 0
else
exit 1
fi
}
TEMPDIR=$(mktemp -d -t firebrand-work-XXXXXXXX)
if [ $? -ne 0 ] ; then
die 1 "Could not create temporary work directory."
fi
if [ "x$NEWICONSDIR" == "x" ] ; then
NEWICONSDIR=$(mktemp -d -t firebrand-icon-XXXXXXXX)
if [ $? -ne 0 ] ; then
die 1 "Could not create temporary icon directory."
fi
else
[ -e "$NEWICONSDIR" ] || mkdir -p "$NEWICONSDIR" || die 1 "Could not create icon directory $NEWICONSDIR."
fi
echo -e "\033[1mChecking replacement icons\033[0m"
get_icon "mozicon50.xpm" "/other-licenses/branding/firefox/mozicon50.xpm?raw=1"
get_icon "mozicon16.xpm" "/other-licenses/branding/firefox/mozicon16.xpm?raw=1"
get_icon "mozicon128.png" "/other-licenses/branding/firefox/mozicon128.png?raw=1"
get_icon "document.png" "/other-licenses/branding/firefox/document.png?raw=1"
get_icon "icon48.png" "/other-licenses/branding/firefox/content/icon48.png?raw=1"
get_icon "icon64.png" "/other-licenses/branding/firefox/content/icon64.png?raw=1"
get_icon "about.png" "/other-licenses/branding/firefox/content/about.png?raw=1"
get_icon "aboutCredits.png" "/other-licenses/branding/firefox/content/aboutCredits.png?raw=1"
get_icon "aboutFooter.png" "/other-licenses/branding/firefox/content/aboutFooter.png?raw=1"
cp "$NEWICONSDIR/mozicon50.xpm" "$NEWICONSDIR/default.xpm"
convert -resize 48x48 "$NEWICONSDIR/mozicon50.xpm" "$NEWICONSDIR/default48.png"
convert -resize 32x32 "$NEWICONSDIR/mozicon50.xpm" "$NEWICONSDIR/default32.png"
convert -resize 16x16 "$NEWICONSDIR/mozicon50.xpm" "$NEWICONSDIR/default16.png"
echo -e "\033[1mBranding chrome/en-US.jar\033[0m"
echo -n " - Unzipping branding files in chrome/en-US.jar to temporary directory... "
unzip -q -d "$TEMPDIR" "$CHROMEDIR/en-US.jar" locale/branding/brand.dtd locale/branding/brand.properties && echo "Done." || die 1 "Failed."
for FILE in $TEMPDIR/locale/branding/* ; do
sed -i "s|$FIREFOXSTRING|Firefox|g" "$FILE" && echo " - Successfully edited ${FILE}" || die 1 "Could not edit ${FILE}."
done
echo -n " - Replacing old branding files in chrome/en-US.jar... "
( cd $TEMPDIR && zip -q -r "$CHROMEDIR/en-US.jar" locale/branding/* ) && echo "Done." || die 1 "Failed."
echo -e "\033[1mBranding chrome/browser.jar\033[0m"
echo -n " - Making new branding icon structure in temporary directory... "
mkdir -p "$TEMPDIR/content/branding" || die 1 "Could not create $TEMPDIR/content/branding."
cp "$NEWICONSDIR"/{about.png,aboutCredits.png,aboutFooter.png,icon48.png,icon64.png} "$TEMPDIR/content/branding/" || die 1 "Could not copy new icons to $TEMPDIR/content/branding/."
echo "Done."
echo -n " - Replacing old branding icon structure in chrome/browser.jar... "
( cd $TEMPDIR && zip -q -r "$CHROMEDIR/browser.jar" content/branding/* ) && echo "Done." || die 1 "Failed."
echo -e "\033[1mBranding defaults/preferences/firefox.js\033[0m"
sed -i "s|$FIREFOXSTRINGPREFS|Firefox|g" $FIREFOXDIR/defaults/preferences/firefox.js && echo " - Successfully edited $FIREFOXDIR/defaults/preferences/firefox.js." || die 1 "Could not edit $FIREFOXDIR/defaults/preferences/firefox.js."
echo -e "\033[1mBranding icons\033[0m"
echo -n " - Replacing icons in chrome/icons/default/... "
cp "$NEWICONSDIR"/{default48.png,default32.png,default16.png} $FIREFOXDIR/chrome/icons/default/ && echo "Done." || die 1 "Failed."
echo -n " - Replacing icons in icons/... "
cp "$NEWICONSDIR"/{document.png,mozicon128.png,mozicon16.xpm,mozicon50.xpm} $FIREFOXDIR/icons/ && echo "Done." || die 1 "Failed."
chmod 644 $FIREFOXDIR/chrome/icons/default/* $FIREFOXDIR/icons/*
chown root:root $FIREFOXDIR/chrome/icons/default/* $FIREFOXDIR/icons/*
echo -n " - Replacing /usr/share/pixmaps/firefox.png: "
convert "$NEWICONSDIR/default.xpm" /usr/share/pixmaps/firefox.png && echo "Done." || die 1 "Failed."
chmod 644 /usr/share/pixmaps/firefox.png
chown root:root /usr/share/pixmaps/firefox.png
oz
Offline
Thank you! It works like a charm.
Only the best is good enough.
Offline
here's a version that works without the 75mb of imagemagick dependencies (still uses curl though, might want to change that to wget )
#!/bin/sh
#
# firebrand - a script to brand firefox without recompilation
#
#
# This script replaces and changes (a few) files in an existing firefox
# installation. Run it after a firefox installation or upgrade, and restart
# firefox. The program icon may not be (visibly) replaced until your desktop
# environment is restarted.
#
# To revert to the original brand, simply reinstall firefox.
#
# Dependencies: curl, zip, unzip
#
#FIREFOXDIR: Where firefox's data files resides.
# Gran Paradiso:
FIREFOXDIR=/usr/lib/firefox-3.0
FIREFOXSTRING="Gran Paradiso"
FIREFOXSTRINGPREFS="GranParadiso"
NEWICONSDIR="" # If empty, the script uses a temporary directory for the replacement icons.
# If you want to avoid downloading the icons every time you rebrand firefox,
# point NEWICONSDIR to a suitable directory.
SOURCEBASE="http://mxr.mozilla.org/seamonkey/source" # The URL under which the "other-licenses" directory resides.
CHROMEDIR=$FIREFOXDIR/chrome # Simply the firefox chrome directory.
die() {
EXITCODE="${1:-9}"
MESSAGE="$2"
echo -e "\n$MESSAGE"
exit $EXITCODE
}
get_icon() {
local ICON="$1"
local SOURCEFILE="$2"
echo -n " - $ICON"
if [ -e "$NEWICONSDIR/$ICON" ] ; then
if [ -f "$NEWICONSDIR/$ICON" ] ; then
echo " is present."
return 0
else
echo " is present but is not a file. Quitting."
exit 1
fi
fi
echo -n ": Downloading... "
if curl -sS "${SOURCEBASE}${SOURCEFILE}" > "$NEWICONSDIR/$ICON" ; then
echo "Done."
return 0
else
exit 1
fi
}
TEMPDIR=$(mktemp -d -t firebrand-work-XXXXXXXX)
if [ $? -ne 0 ] ; then
die 1 "Could not create temporary work directory."
fi
if [ "x$NEWICONSDIR" == "x" ] ; then
NEWICONSDIR=$(mktemp -d -t firebrand-icon-XXXXXXXX)
if [ $? -ne 0 ] ; then
die 1 "Could not create temporary icon directory."
fi
else
[ -e "$NEWICONSDIR" ] || mkdir -p "$NEWICONSDIR" || die 1 "Could not create icon directory $NEWICONSDIR."
fi
echo -e "\033[1mChecking replacement icons\033[0m"
get_icon "mozicon50.xpm" "/other-licenses/branding/firefox/mozicon50.xpm?raw=1"
get_icon "mozicon16.xpm" "/other-licenses/branding/firefox/mozicon16.xpm?raw=1"
get_icon "mozicon128.png" "/other-licenses/branding/firefox/mozicon128.png?raw=1"
get_icon "document.png" "/other-licenses/branding/firefox/document.png?raw=1"
get_icon "icon48.png" "/other-licenses/branding/firefox/content/icon48.png?raw=1"
get_icon "icon64.png" "/other-licenses/branding/firefox/content/icon64.png?raw=1"
get_icon "about.png" "/other-licenses/branding/firefox/content/about.png?raw=1"
get_icon "aboutCredits.png" "/other-licenses/branding/firefox/content/aboutCredits.png?raw=1"
get_icon "aboutFooter.png" "/other-licenses/branding/firefox/content/aboutFooter.png?raw=1"
get_icon "default16.png" "/other-licenses/branding/firefox/default16.png?raw=1"
get_icon "default32.png" "/other-licenses/branding/firefox/default32.png?raw=1"
get_icon "default48.png" "/other-licenses/branding/firefox/default48.png?raw=1"
cp "$NEWICONSDIR/mozicon50.xpm" "$NEWICONSDIR/default.xpm"
cp "$NEWICONSDIR/default16.png" "$NEWICONSDIR/default16.png"
cp "$NEWICONSDIR/default32.png" "$NEWICONSDIR/default32.png"
cp "$NEWICONSDIR/default48.png" "$NEWICONSDIR/default48.png"
cp "$NEWICONSDIR/icon64.png" "/usr/share/pixmaps/firefox.png"
echo -e "\033[1mBranding chrome/en-US.jar\033[0m"
echo -n " - Unzipping branding files in chrome/en-US.jar to temporary directory... "
unzip -q -d "$TEMPDIR" "$CHROMEDIR/en-US.jar" locale/branding/brand.dtd locale/branding/brand.properties && echo "Done." || die 1 "Failed."
for FILE in $TEMPDIR/locale/branding/* ; do
sed -i "s|$FIREFOXSTRING|Firefox|g" "$FILE" && echo " - Successfully edited ${FILE}" || die 1 "Could not edit ${FILE}."
done
echo -n " - Replacing old branding files in chrome/en-US.jar... "
( cd $TEMPDIR && zip -q -r "$CHROMEDIR/en-US.jar" locale/branding/* ) && echo "Done." || die 1 "Failed."
echo -e "\033[1mBranding chrome/browser.jar\033[0m"
echo -n " - Making new branding icon structure in temporary directory... "
mkdir -p "$TEMPDIR/content/branding" || die 1 "Could not create $TEMPDIR/content/branding."
cp "$NEWICONSDIR"/{about.png,aboutCredits.png,aboutFooter.png,icon48.png,icon64.png} "$TEMPDIR/content/branding/" || die 1 "Could not copy new icons to $TEMPDIR/content/branding/."
echo "Done."
echo -n " - Replacing old branding icon structure in chrome/browser.jar... "
( cd $TEMPDIR && zip -q -r "$CHROMEDIR/browser.jar" content/branding/* ) && echo "Done." || die 1 "Failed."
echo -e "\033[1mBranding defaults/preferences/firefox.js\033[0m"
sed -i "s|$FIREFOXSTRINGPREFS|Firefox|g" $FIREFOXDIR/defaults/preferences/firefox.js && echo " - Successfully edited $FIREFOXDIR/defaults/preferences/firefox.js." || die 1 "Could not edit $FIREFOXDIR/defaults/preferences/firefox.js."
echo -e "\033[1mBranding icons\033[0m"
echo -n " - Replacing icons in chrome/icons/default/... "
cp "$NEWICONSDIR"/{default48.png,default32.png,default16.png} $FIREFOXDIR/chrome/icons/default/ && echo "Done." || die 1 "Failed."
echo -n " - Replacing icons in icons/... "
cp "$NEWICONSDIR"/{document.png,mozicon128.png,mozicon16.xpm,mozicon50.xpm} $FIREFOXDIR/icons/ && echo "Done." || die 1 "Failed."
chmod 644 $FIREFOXDIR/chrome/icons/default/* $FIREFOXDIR/icons/*
chown root:root $FIREFOXDIR/chrome/icons/default/* $FIREFOXDIR/icons/*
chmod 644 /usr/share/pixmaps/firefox.png
chown root:root /usr/share/pixmaps/firefox.png
ᶘ ᵒᴥᵒᶅ
Offline
Great!
Offline
Really love the plain old Firefox icon. Just run it on my system. So far so good.
Offline
It was the only way to get gtalk working in orkut, so thanks!
Offline
I've gotten this script to work before, but I reinstalled firefox and now it won't run properly, I keep getting really stupid errors in python.
For instance:
File "firebrand.py", line 35
die() {
^
SyntaxError: invalid syntax
I moved the { down a line to see what it would do and it gave me an error on the next line of code, what could be causing this?
Offline
It's a bash script, not a python script
Offline
wow I feel like an idiot, don't know why I had it labeled as a .py file
Offline
here's a version that works without the 75mb of imagemagick dependencies (still uses curl though, might want to change that to wget )
#!/bin/sh # # firebrand - a script to brand firefox without recompilation # # # This script replaces and changes (a few) files in an existing firefox # installation. Run it after a firefox installation or upgrade, and restart # firefox. The program icon may not be (visibly) replaced until your desktop # environment is restarted. # # To revert to the original brand, simply reinstall firefox. # # Dependencies: curl, zip, unzip # #FIREFOXDIR: Where firefox's data files resides. # Gran Paradiso: FIREFOXDIR=/usr/lib/firefox-3.0 FIREFOXSTRING="Gran Paradiso" FIREFOXSTRINGPREFS="GranParadiso" NEWICONSDIR="" # If empty, the script uses a temporary directory for the replacement icons. # If you want to avoid downloading the icons every time you rebrand firefox, # point NEWICONSDIR to a suitable directory. SOURCEBASE="http://mxr.mozilla.org/seamonkey/source" # The URL under which the "other-licenses" directory resides. CHROMEDIR=$FIREFOXDIR/chrome # Simply the firefox chrome directory. die() { EXITCODE="${1:-9}" MESSAGE="$2" echo -e "\n$MESSAGE" exit $EXITCODE } get_icon() { local ICON="$1" local SOURCEFILE="$2" echo -n " - $ICON" if [ -e "$NEWICONSDIR/$ICON" ] ; then if [ -f "$NEWICONSDIR/$ICON" ] ; then echo " is present." return 0 else echo " is present but is not a file. Quitting." exit 1 fi fi echo -n ": Downloading... " if curl -sS "${SOURCEBASE}${SOURCEFILE}" > "$NEWICONSDIR/$ICON" ; then echo "Done." return 0 else exit 1 fi } TEMPDIR=$(mktemp -d -t firebrand-work-XXXXXXXX) if [ $? -ne 0 ] ; then die 1 "Could not create temporary work directory." fi if [ "x$NEWICONSDIR" == "x" ] ; then NEWICONSDIR=$(mktemp -d -t firebrand-icon-XXXXXXXX) if [ $? -ne 0 ] ; then die 1 "Could not create temporary icon directory." fi else [ -e "$NEWICONSDIR" ] || mkdir -p "$NEWICONSDIR" || die 1 "Could not create icon directory $NEWICONSDIR." fi echo -e "\033[1mChecking replacement icons\033[0m" get_icon "mozicon50.xpm" "/other-licenses/branding/firefox/mozicon50.xpm?raw=1" get_icon "mozicon16.xpm" "/other-licenses/branding/firefox/mozicon16.xpm?raw=1" get_icon "mozicon128.png" "/other-licenses/branding/firefox/mozicon128.png?raw=1" get_icon "document.png" "/other-licenses/branding/firefox/document.png?raw=1" get_icon "icon48.png" "/other-licenses/branding/firefox/content/icon48.png?raw=1" get_icon "icon64.png" "/other-licenses/branding/firefox/content/icon64.png?raw=1" get_icon "about.png" "/other-licenses/branding/firefox/content/about.png?raw=1" get_icon "aboutCredits.png" "/other-licenses/branding/firefox/content/aboutCredits.png?raw=1" get_icon "aboutFooter.png" "/other-licenses/branding/firefox/content/aboutFooter.png?raw=1" get_icon "default16.png" "/other-licenses/branding/firefox/default16.png?raw=1" get_icon "default32.png" "/other-licenses/branding/firefox/default32.png?raw=1" get_icon "default48.png" "/other-licenses/branding/firefox/default48.png?raw=1" cp "$NEWICONSDIR/mozicon50.xpm" "$NEWICONSDIR/default.xpm" cp "$NEWICONSDIR/default16.png" "$NEWICONSDIR/default16.png" cp "$NEWICONSDIR/default32.png" "$NEWICONSDIR/default32.png" cp "$NEWICONSDIR/default48.png" "$NEWICONSDIR/default48.png" cp "$NEWICONSDIR/icon64.png" "/usr/share/pixmaps/firefox.png" echo -e "\033[1mBranding chrome/en-US.jar\033[0m" echo -n " - Unzipping branding files in chrome/en-US.jar to temporary directory... " unzip -q -d "$TEMPDIR" "$CHROMEDIR/en-US.jar" locale/branding/brand.dtd locale/branding/brand.properties && echo "Done." || die 1 "Failed." for FILE in $TEMPDIR/locale/branding/* ; do sed -i "s|$FIREFOXSTRING|Firefox|g" "$FILE" && echo " - Successfully edited ${FILE}" || die 1 "Could not edit ${FILE}." done echo -n " - Replacing old branding files in chrome/en-US.jar... " ( cd $TEMPDIR && zip -q -r "$CHROMEDIR/en-US.jar" locale/branding/* ) && echo "Done." || die 1 "Failed." echo -e "\033[1mBranding chrome/browser.jar\033[0m" echo -n " - Making new branding icon structure in temporary directory... " mkdir -p "$TEMPDIR/content/branding" || die 1 "Could not create $TEMPDIR/content/branding." cp "$NEWICONSDIR"/{about.png,aboutCredits.png,aboutFooter.png,icon48.png,icon64.png} "$TEMPDIR/content/branding/" || die 1 "Could not copy new icons to $TEMPDIR/content/branding/." echo "Done." echo -n " - Replacing old branding icon structure in chrome/browser.jar... " ( cd $TEMPDIR && zip -q -r "$CHROMEDIR/browser.jar" content/branding/* ) && echo "Done." || die 1 "Failed." echo -e "\033[1mBranding defaults/preferences/firefox.js\033[0m" sed -i "s|$FIREFOXSTRINGPREFS|Firefox|g" $FIREFOXDIR/defaults/preferences/firefox.js && echo " - Successfully edited $FIREFOXDIR/defaults/preferences/firefox.js." || die 1 "Could not edit $FIREFOXDIR/defaults/preferences/firefox.js." echo -e "\033[1mBranding icons\033[0m" echo -n " - Replacing icons in chrome/icons/default/... " cp "$NEWICONSDIR"/{default48.png,default32.png,default16.png} $FIREFOXDIR/chrome/icons/default/ && echo "Done." || die 1 "Failed." echo -n " - Replacing icons in icons/... " cp "$NEWICONSDIR"/{document.png,mozicon128.png,mozicon16.xpm,mozicon50.xpm} $FIREFOXDIR/icons/ && echo "Done." || die 1 "Failed." chmod 644 $FIREFOXDIR/chrome/icons/default/* $FIREFOXDIR/icons/* chown root:root $FIREFOXDIR/chrome/icons/default/* $FIREFOXDIR/icons/* chmod 644 /usr/share/pixmaps/firefox.png chown root:root /usr/share/pixmaps/firefox.png
Very nice, worked second time (after I installed zip )
Offline
Beautiful. This script works like a charm
Offline
Would it be possible to update the script to fix the user agent as well?
Mine still says GranParadiso/3.0.10 after running.
Thanks, and great job!
Offline
Would it be possible to update the script to fix the user agent as well?
Mine still says GranParadiso/3.0.10 after running.
Thanks, and great job!
Hm, it should fix the useragent too. My guess is that you used my original script, which was for "Bon Echo". Use litemotiv's version a few posts above, that should do it.
Offline
Thanks Bebo and litemotiv (who's script I just used). I like getting rid of the Gran Paradiso nonsense. I know the name didn't affect anything with how the browser operates, I just like having it say Firefox. I tried the spookyet version from AUR a while ago. It was OK but it took forever and a day to complile, plus it didn't get updated when a new version came out. This rebranding script is so much quicker - it took just a few seconds and it was done.
Offline