You are not logged in.
Mmm yeah! I used litemotiv's script. Works perfectly.
Offline
Thanks guys, works great!
Russ
Offline
I know the name didn't affect anything with how the browser operates, I just like having it say Firefox.
Actually the name does affect how it operates(some)! A few silly sites use the "user agent" string, to decide what javascript or css or whatever weird features to enable. Yahoo pages do this some, but I don't think it disables much.
Offline
Bebo/litemotiv: Can has permission to redistribute your script? I'd like it to be part of a repository for a soon-to-be-unveiled project (NOT µpkg).
# (a month later) ...never mind.
Last edited by Peasantoid (2009-05-23 19:07:27)
Offline
Thank you! Worked without problems.
< Daenyth> tomkx: my girlfriend is linux
< Daenyth> srsly
< Daenyth> she loves the way I «make install»
< Daenyth> all her /dev entries are mode 7 for me
Offline
Bebo/litemotiv: Can has permission to redistribute your script? I'd like it to be part of a repository for a soon-to-be-unveiled project (NOT µpkg).
# (a month later) ...never mind.
I'm very sorry, I've somehow missed this. I have no problems whatsoever with you redistributing the script, I'm just happy it's used I can't answer for litemotiv though.
Offline
litemotiv's script worked like a charm for me! (Firefox 3.0.10)
Thanks
Offline
can someone update this for firefox 3.5? editing the firefox path from firefox-3.0 to firefox-3.5 does a half way job at it, the about page says firefox, and the icon changes, but the title bar is still shiretoko...can someone finish the job please? thanks!
Offline
can someone update this for firefox 3.5? editing the firefox path from firefox-3.0 to firefox-3.5 does a half way job at it, the about page says firefox, and the icon changes, but the title bar is still shiretoko...can someone finish the job please? thanks!
Find both places in script where it says "Gran Paradiso" and replace them to "Shiretoko" (code name (?) for 3.5). Then re-run script. Or apply this patch on /usr/bin/firebrand:
--- /usr/bin/firebrand 2008-11-23 22:29:20.000000000 +0200
+++ /usr/bin/firebrand.new 2009-07-02 15:43:56.000000000 +0300
@@ -17,7 +17,7 @@
exit 1
fi
-FIREFOXDIR=/usr/lib/firefox-3.0
+FIREFOXDIR=/usr/lib/firefox-3.5
CHROMEDIR=$FIREFOXDIR/chrome
@@ -47,7 +47,7 @@
unzip -q -d "$TEMPDIR" "$CHROMEDIR/en-US.jar" locale/branding/brand.dtd locale/branding/brand.properties && echo "Done." || die 1 "Could not unzip branding files."
for FILE in $TEMPDIR/locale/branding/* ; do
- sed -i 's|Gran Paradiso|Mozilla Firefox|g' "$FILE" && echo " - Successfully edited ${FILE}" || die 1 "Could not edit ${FILE}."
+ sed -i 's|Shiretoko|Mozilla Firefox|g' "$FILE" && echo " - Successfully edited ${FILE}" || die 1 "Could not edit ${FILE}."
done
echo " - Replacing branding files in en-US.jar"
@@ -64,7 +64,7 @@
echo -e "\033[1mRE-BRANDING defaults/preferences/firefox.js\033[0m"
-sed -i 's|Gran Paradiso|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."
+sed -i 's|Shiretoko|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."
Offline
I've edited my initial post so that noone is tricked into using my first script. Use litemotiv's script instead. To get it to work for 3.5 it ought to be as simple as changing the first three variables in the script (well, I haven't tested it on 3.5 myself yet, but judging from your reports it may very well be as simple as that).
Offline
Here's a new version where you won't have to edit anything yourself. The changes are:
- The firefox directory in /usr/lib is "autodetected" (ls...)
- Better sed:ing, where the codename isn't hardcoded any more.
- Uses wget instead of curl, on popular demand
(FYI: I've tinkered a little with bsdtar, but couldn't make the zipping work, so zip and unzip are still there as dependencies.)
#!/bin/bash
#
# 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: wget, unzip, zip
#
FIREFOXDIR="" # Where firefox's data files resides. Usually something like /usr/lib/firefox-3.5.
# If empty, autodetection is attempted.
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.
die() {
local EXITCODE="${1:-9}"
local MESSAGE="$2"
[ "x$MESSAGE" == "x" ] || echo -e "$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
die 1 " is present but is not a file. Quitting."
fi
fi
echo -n ": Downloading... "
#if curl -sSL "${SOURCEBASE}${SOURCEFILE}" > "$NEWICONSDIR/$ICON" ; then
if wget -q -O - "${SOURCEBASE}${SOURCEFILE}" > "$NEWICONSDIR/$ICON" ; then
echo "Done."
return 0
else
die 1 "Failed."
fi
}
for EXEC in wget unzip zip ; do
if ! which $EXEC > /dev/null 2>&1 ; then
die 1 "This script requires $EXEC to work."
fi
done
if [ "x$FIREFOXDIR" == "x" ] ; then
FIREFOXDIR=$(ls -1d /usr/lib/firefox-* | sort | tail -1)
if [ "x$FIREFOXDIR" == "x" ] ; then
die 1 "Could not find the Firefox data directory."
fi
echo "Firefox data directory is ${FIREFOXDIR}."
fi
if [ ! -d "$FIREFOXDIR" ] ; then
die 1 "$FIREFOXDIR is not a directory."
fi
CHROMEDIR=$FIREFOXDIR/chrome # Simply the firefox chrome directory.
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"
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|${OFFICIAL_NAME}|Firefox|g" "$FILE" && echo " - Successfully edited ${FILE}" || die 1 "Could not edit ${FILE}."
#done
sed -r -i 's_((brandShortName|brandFullName)[ \t]+)"[^"]+"_\1"Firefox"_g' $TEMPDIR/locale/branding/brand.dtd && echo " - Edited brand.dtd" || die 1 "Could not edit brand.dtd."
sed -r -i 's_^(brandShortName|brandFullName)=.*$_\1=Firefox_g' $TEMPDIR/locale/branding/brand.properties && echo " - Edited brand.properties" || die 1 "Could not edit brand.properties."
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|${USERAGENT_NAME}|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."
sed -r -i 's_^(pref\("general.useragent.extra.firefox", ")[^/]+(/.*"\);[ \t]*)$_\1Firefox\2_' $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: "
cp "$NEWICONSDIR/icon64.png" "/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
Edited 2009-07-13 to fix the problem in post #63.
Last edited by Bebo (2009-07-13 15:49:37)
Offline
Has anyone got this to work for 3.5? The one in the OP doesn't work with the edited variables, and the one in Bebo's post fails with,
[robert@arch64 ~]$ sudo ./fb.sh
Firefox data directory is /usr/lib/firefox-3.0
/usr/lib/firefox-3.5.
/usr/lib/firefox-3.0
/usr/lib/firefox-3.5 is not a directory.
Which is odd, because /usr/lib/firefox-3.5 is a directory.
Offline
Has anyone got this to work for 3.5? The one in the OP doesn't work with the edited variables, and the one in Bebo's post fails with,
[robert@arch64 ~]$ sudo ./fb.sh Firefox data directory is /usr/lib/firefox-3.0 /usr/lib/firefox-3.5. /usr/lib/firefox-3.0 /usr/lib/firefox-3.5 is not a directory.
Which is odd, because /usr/lib/firefox-3.5 is a directory.
Argh, sorry, I didn't think about that... You have several directories matching "/usr/lib/firefox-*" (why?). I've edited the script above (post #62), please try again.
Offline
Argh, sorry, I didn't think about that... You have several directories matching "/usr/lib/firefox-*" (why?). I've edited the script above (post #62), please try again.
I don't know, it's a 2 week old install of arch-64, I haven't done anything funny to it. But thanks a lot, it works now.
Offline
Argh, sorry, I didn't think about that... You have several directories matching "/usr/lib/firefox-*" (why?). I've edited the script above (post #62), please try again.
It worked perfectly for me as well... THANKS!
oz
Offline
I took the liberty to update Bebo's script so it provides the new refurbished Firefox 3.5 icon by using the 3.5 sourcebase and adding additional icons (256x256, 24x24, 22x22) for download and replacement.
#!/bin/bash
#
# 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: wget, unzip, zip
#
FIREFOXDIR="" # Where firefox's data files resides. Usually something like /usr/lib/firefox-3.5.
# If empty, autodetection is attempted.
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/mozilla1.9.1/source" # The URL under which the "other-licenses" directory resides.
die() {
local EXITCODE="${1:-9}"
local MESSAGE="$2"
[ "x$MESSAGE" == "x" ] || echo -e "$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
die 1 " is present but is not a file. Quitting."
fi
fi
echo -n ": Downloading... "
#if curl -sSL "${SOURCEBASE}${SOURCEFILE}" > "$NEWICONSDIR/$ICON" ; then
if wget -q -O - "${SOURCEBASE}${SOURCEFILE}" > "$NEWICONSDIR/$ICON" ; then
echo "Done."
return 0
else
die 1 "Failed."
fi
}
for EXEC in wget unzip zip ; do
if ! which $EXEC > /dev/null 2>&1 ; then
die 1 "This script requires $EXEC to work."
fi
done
if [ "x$FIREFOXDIR" == "x" ] ; then
FIREFOXDIR=$(ls -1d /usr/lib/firefox-* | sort | tail -1)
if [ "x$FIREFOXDIR" == "x" ] ; then
die 1 "Could not find the Firefox data directory."
fi
echo "Firefox data directory is ${FIREFOXDIR}."
fi
if [ ! -d "$FIREFOXDIR" ] ; then
die 1 "$FIREFOXDIR is not a directory."
fi
CHROMEDIR=$FIREFOXDIR/chrome # Simply the firefox chrome directory.
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 "default22.png" "/other-licenses/branding/firefox/default22.png?raw=1"
get_icon "default24.png" "/other-licenses/branding/firefox/default24.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"
get_icon "default256.png" "/other-licenses/branding/firefox/default256.png?raw=1"
cp "$NEWICONSDIR/mozicon50.xpm" "$NEWICONSDIR/default.xpm"
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|${OFFICIAL_NAME}|Firefox|g" "$FILE" && echo " - Successfully edited ${FILE}" || die 1 "Could not edit ${FILE}."
#done
sed -r -i 's_((brandShortName|brandFullName)[ \t]+)"[^"]+"_\1"Firefox"_g' $TEMPDIR/locale/branding/brand.dtd && echo " - Edited brand.dtd" || die 1 "Could not edit brand.dtd."
sed -r -i 's_^(brandShortName|brandFullName)=.*$_\1=Firefox_g' $TEMPDIR/locale/branding/brand.properties && echo " - Edited brand.properties" || die 1 "Could not edit brand.properties."
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|${USERAGENT_NAME}|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."
sed -r -i 's_^(pref\("general.useragent.extra.firefox", ")[^/]+(/.*"\);[ \t]*)$_\1Firefox\2_' $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"/{default256.png,default48.png,default32.png,default24.png,default22.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: "
cp "$NEWICONSDIR/icon64.png" "/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
Old:
New:
And here's the huge 256x256:
For more info about the new icon: http://blog.mozilla.com/faaborg/2009/06 … efox-icon/
As mentioned there, they will release the icon in vector format!
Last edited by mekwall (2009-08-08 09:14:39)
Offline
@mekwall: Ah, cool, thanks
Offline
mekwall thank you, works flawless.
zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)
Offline
@mekwall
Thanx for releasing that update. Just tested it here and works perfectly.
Offline
@developers/contributers: Thx vm. Really nice!
Offline
THank you mekwall, your script worked flawlessly with FF 3.5.5. I have a question though: wouldn't it be more useful to put this script on github or some place else where it would be a) easier to download and b) easier to fork / maintain?
Offline
Thanks!
Offline
Thanks alot this works great! on 3.5
Linux ArchLinux 3.2.8-1-ARCH
#1 SMP PREEMPT Mon Feb 27 21:51:46 CET 2012 x86_64 AMD FX(tm)-8120 Eight-Core Processor AuthenticAMD GNU/Linux
8192MB DDR3 1300MHz | Asus m5a97 | GeForce GTX 550 Ti | 120 GB SSD
Offline
Hi all. New Arch user here. Just ran this script and it worked, but only for the root user. My everyday user is still using generic icons. Any suggestions?
Offline
Hm, it needs to be run with root privileges to access the files it changes, but it should work for any user after that. Did you try logging out and in again? I haven't checked how it behaves the last few times I've run it, but I believe the desktop and menus need to be "refreshed" afterwards to load the new icons. If you're saying that it doesn't work in FF, then I don't know what is happening.
Offline