Page 1 of 17 12311 ... LastLast
Results 1 to 10 of 162

Thread: SCRIPT: Take back the Firefox & Thunderbird logo

  1. #1
    Join Date
    Feb 2005
    Location
    Geneva, Switzerland
    Beans
    976

    Wink SCRIPT: Take back the Firefox & Thunderbird icon

    This script is for Dapper only !!!
    To use it with Hoary or Breezy please follow this thread !



    Note for Edgy users:
    Some folks say that it works in Edgy, too (I have not tested it). However you need to use

    Code:
    $ sudo bash restore_mozilla_icons
    instead of
    Code:
    $ sudo restore_mozilla_icons
    to get it work.



    This script is intended to replace the blue globe with the original Firefox icon. It also replaces the Thunderbird icon. Works with both Gnome and KDE.



    You have the choice to replace the Firefox program icon, the Firefox document icon, the Thunderbird program icon and/or the Thunderbird profile manager icon.

    Here we go:
    • Create a new script:
      (KDE users: replace 'gedit' with 'kate')
      Code:
      $ sudo gedit /usr/local/bin/restore_mozilla_icons
    • Paste the following lines:
      Code:
      #! /bin/sh
      
      #
      # Restore the original Firefox and/or Thunderbird icons.
      #
      
      #
      # TODO: Create and implement SVG icons
      #
      
      FIREFOX_LIB="/usr/lib/firefox/"
      FIREFOX_BIN="/usr/bin/mozilla-firefox"
      THUNDERBIRD_BIN="/usr/bin/mozilla-thunderbird"
      
      ICON_PACK_URL="http://ubuntu.globalvision.ch/mozilla_icons_dapper.tar.bz2"
      ICON_PACK_FILENAME="mozilla_icons_dapper.tar.bz2"
      TMP_DIR="/tmp/moz-icons"$$"/"
      
      
      #Ctrl-C trapping
      trap ctrlc INT
      ctrlc()
      {
      	echo -e "\nAborted by user."
      	rm -rf $TMP_DIR
      	exit 2
      }
      
      #Input read function
      readyn()
      {
      	read input
      	if [ -z "$input" ] || [ "$input" == "y" ] || [ "$input" == "yes" ] || [ "$input" == "Y" ] || [ "$input" == "YES" ] ; then
      		echo 1
      		return
      	fi
      	echo 0
      }
      
      
      #Check if run as root
      if [ "$UID" -ne 0 ] ; then
      	echo "You must be root to do that!"
      	exit 1
      fi
      
      
      #Ask which icons to replace
      replace_ff="0"
      replace_ff_doc="0"
      replace_tb="0"
      replace_tb_pm="0"
      
      if [ -x "$FIREFOX_BIN" ] ; then
      	#Firefox
      	echo -n "Replace the Mozilla Firefox program icon (y/n)? [y] "
      	if [ `readyn` -ne 0 ] ; then
      		replace_ff="1"
      	fi
      
      	#Firefox document
      	echo -n "Replace the Mozilla Firefox document icon (y/n)? [y] "
      	if [ `readyn` -ne 0 ] ; then
      		replace_ff_doc="1"
      	fi
      fi
      
      if [ -x "$THUNDERBIRD_BIN" ] ; then
      	#Thunderbird
      	echo -n "Replace the Mozilla Thunderbird program icon (y/n)? [y] "
      	if [ `readyn` -ne 0 ] ; then
      		replace_tb="1"
      	fi
      
      	#Thunderbird profile manager
      	echo -n "Replace the Mozilla Thunderbird profile manager icon (y/n)? [y] "
      	if [ `readyn` -ne 0 ] ; then
      		replace_tb_pm="1"
      	fi
      fi
      
      if [ "$replace_ff" -eq "0" ] && [ "$replace_ff_doc" -eq "0" ] && [ "$replace_tb" -eq "0" ] && [ "$replace_tb_pm" -eq "0" ] ; then
      	echo "Nothing to do here."
      	exit 0
      fi
      
      
      #Ask for divert the original packaged files to alternate locations
      divert="0"
      
      echo -e "\nDo you want to divert the original packaged files to alternate locations"
      echo -n "(make the changes permanent) (y/n)? [y] "
      if [ `readyn` -ne 0 ] ; then
      	divert="1"
      fi
      
      
      #Downloading
      echo -en "\nDownloading and replacing icons. Please wait..."
      
      mkdir $TMP_DIR
      wget $ICON_PACK_URL -O $TMP_DIR$ICON_PACK_FILENAME >/dev/null 2>&1
      if [ ! -f $TMP_DIR$ICON_PACK_FILENAME ] ; then
      	echo -e "\nCannot download icons. Please check your internet connection."
      	rm -rf $TMP_DIR
      	exit 1
      fi
      tar xjf $TMP_DIR$ICON_PACK_FILENAME -C $TMP_DIR
      
      
      #Replace Firefox icon
      if [ "$replace_ff" -gt "0" ] ; then
      	if [ ! -f $TMP_DIR"mozilla-firefox.png" ] || [ ! -f $TMP_DIR"mozilla-firefox.xpm" ] ; then
      		echo "Cannot continue (unavailable Firefox icon file)"
      		rm -rf $TMP_DIR
      		exit 1
      	fi
      
      	#Backup
      	cp -f /usr/share/pixmaps/firefox.png /usr/share/pixmaps/firefox.old.png
      	cp -f /usr/share/pixmaps/mozilla-firefox.xpm /usr/share/pixmaps/mozilla-firefox.old.xpm
      	cp -f $FIREFOX_LIB"icons/default.xpm" $FIREFOX_LIB"icons/default.old.xpm"
      	cp -f $FIREFOX_LIB"chrome/icons/default/default.xpm" $FIREFOX_LIB"chrome/icons/default/default.old.xpm"
      
      	#Divert
      	if [ "$divert" -gt "0" ] ; then
      		dpkg-divert --rename /usr/share/pixmaps/firefox.png >/dev/null
      		dpkg-divert --rename /usr/share/pixmaps/mozilla-firefox.xpm >/dev/null
      		dpkg-divert --rename /usr/share/firefox/icons/default.xpm >/dev/null
      		dpkg-divert --rename /usr/share/firefox/chrome/icons/default/default.xpm >/dev/null
      	fi
      
      	#Replace icons
      	cp $TMP_DIR"mozilla-firefox.png" /usr/share/pixmaps/firefox.png
      	cp $TMP_DIR"mozilla-firefox.xpm" /usr/share/pixmaps/mozilla-firefox.xpm
      	cp $TMP_DIR"mozilla-firefox.xpm" $FIREFOX_LIB"icons/default.xpm"
      	cp $TMP_DIR"mozilla-firefox.xpm" $FIREFOX_LIB"chrome/icons/default/default.xpm"
      	echo -n "."
      fi
      
      
      #Replace Firefox document icon
      if [ "$replace_ff_doc" -gt "0" ] ; then
      	if [ ! -f $TMP_DIR"mozilla-firefox-doc.png" ] ; then
      		echo "Cannot continue (unavailable Firefox document icon file)"
      		rm -rf $TMP_DIR
      		exit 1
      	fi
      
      	#Backup
      	cp -f $FIREFOX_LIB"icons/document.png" $FIREFOX_LIB"icons/document.old.png"
      
      	#Divert
      	if [ "$divert" -gt "0" ] ; then
      		dpkg-divert --rename /usr/share/firefox/icons/document.png >/dev/null
      	fi
      
      	#Replace icons
      	cp $TMP_DIR"mozilla-firefox-doc.png" $FIREFOX_LIB"icons/document.png"
      	echo -n "."
      fi
      
      
      #Replace Thunderbird icon
      if [ "$replace_tb" -gt "0" ] ; then
      	#TODO: if [ ! -f $TMP_DIR"mozilla-thunderbird.png" ] || [ ! -f $TMP_DIR"mozilla-thunderbird.svg" ] || [ ! -f $TMP_DIR"mozilla-thunderbird.xpm" ] ; then
      	if [ ! -f $TMP_DIR"mozilla-thunderbird.png" ] || [ ! -f $TMP_DIR"mozilla-thunderbird.xpm" ] ; then
      		echo "Cannot continue (unavailable Thunderbird icon file)"
      		rm -rf $TMP_DIR
      		exit 1
      	fi
      
      	#Backup
      	cp -f /usr/share/pixmaps/mozilla-thunderbird.png /usr/share/pixmaps/mozilla-thunderbird.old.png
      	#TODO: cp -f /usr/share/pixmaps/mozilla-thunderbird.svg /usr/share/pixmaps/mozilla-thunderbird.old.svg
      	cp -f /usr/share/pixmaps/mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird.old.xpm
      	cp -f /usr/share/pixmaps/mozilla-thunderbird-menu.png /usr/share/pixmaps/mozilla-thunderbird-menu.old.png
      	#TODO: cp -f /usr/share/pixmaps/mozilla-thunderbird-menu.svg /usr/share/pixmaps/mozilla-thunderbird-menu.old.svg
      	cp -f /usr/share/pixmaps/mozilla-thunderbird-menu.xpm /usr/share/pixmaps/mozilla-thunderbird-menu.old.xpm
      	cp -f /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.old.xpm
      	cp -f /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.old.xpm
      	cp -f /usr/lib/mozilla-thunderbird/icons/default.xpm /usr/lib/mozilla-thunderbird/icons/default.old.xpm
      	cp -f /usr/lib/mozilla-thunderbird/icons/mozicon16.xpm /usr/lib/mozilla-thunderbird/icons/mozicon16.old.xpm
      	cp -f /usr/lib/mozilla-thunderbird/icons/mozicon50.xpm /usr/lib/mozilla-thunderbird/icons/mozicon50.old.xpm
      
      	#Divert
      	if [ "$divert" -gt "0" ] ; then
      		dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird.png >/dev/null
      		#TODO: dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird.svg >/dev/null
      		dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird.xpm >/dev/null
      		dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-menu.png >/dev/null
      		#TODO: dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-menu.svg >/dev/null
      		dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-menu.xpm >/dev/null
      		dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm >/dev/null
      		dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm >/dev/null
      		dpkg-divert --rename /usr/lib/mozilla-thunderbird/icons/default.xpm >/dev/null
      		dpkg-divert --rename /usr/lib/mozilla-thunderbird/icons/mozicon16.xpm >/dev/null
      		dpkg-divert --rename /usr/lib/mozilla-thunderbird/icons/mozicon50.xpm >/dev/null
      	fi
      
      	#Replace icons
      	cp $TMP_DIR"mozilla-thunderbird.png" /usr/share/pixmaps/mozilla-thunderbird.png
      	#TODO: cp $TMP_DIR"mozilla-thunderbird.svg" /usr/share/pixmaps/mozilla-thunderbird.svg
      	cp $TMP_DIR"mozilla-thunderbird.xpm" /usr/share/pixmaps/mozilla-thunderbird.xpm
      	cp $TMP_DIR"mozilla-thunderbird.png" /usr/share/pixmaps/mozilla-thunderbird-menu.png
      	#TODO: cp $TMP_DIR"mozilla-thunderbird.svg" /usr/share/pixmaps/mozilla-thunderbird-menu.svg
      	cp $TMP_DIR"mozilla-thunderbird.xpm" /usr/share/pixmaps/mozilla-thunderbird-menu.xpm
      	cp $TMP_DIR"mozilla-thunderbird.xpm" /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm
      	cp $TMP_DIR"mozilla-thunderbird.xpm" /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm
      	cp $TMP_DIR"mozilla-thunderbird.xpm" /usr/lib/mozilla-thunderbird/icons/default.xpm
      	cp $TMP_DIR"mozilla-thunderbird.xpm" /usr/lib/mozilla-thunderbird/icons/mozicon16.xpm
      	cp $TMP_DIR"mozilla-thunderbird.xpm" /usr/lib/mozilla-thunderbird/icons/mozicon50.xpm
      	echo -n "."
      fi
      
      
      #Replace Thunderbird profile manager icon
      if [ "$replace_tb_pm" -gt "0" ] ; then
      	#TODO: if [ ! -f $TMP_DIR"mozilla-thunderbird-pm.png" ] || [ ! -f $TMP_DIR"mozilla-thunderbird-pm.svg" ] || [ ! -f $TMP_DIR"mozilla-thunderbird-pm.xpm" ] ; then
      	if [ ! -f $TMP_DIR"mozilla-thunderbird-pm.png" ] || [ ! -f $TMP_DIR"mozilla-thunderbird-pm.xpm" ] ; then
      		echo "Cannot continue (unavailable Thunderbird icon file)"
      		rm -rf $TMP_DIR
      		exit 1
      	fi
      
      	#Backup
      	cp -f /usr/share/pixmaps/mozilla-thunderbird-pm.png /usr/share/pixmaps/mozilla-thunderbird-pm.old.png
      	#TODO: cp -f /usr/share/pixmaps/mozilla-thunderbird-pm.svg /usr/share/pixmaps/mozilla-thunderbird-pm.old.svg
      	cp -f /usr/share/pixmaps/mozilla-thunderbird-pm.xpm /usr/share/pixmaps/mozilla-thunderbird-pm.old.xpm
      	cp -f /usr/share/pixmaps/mozilla-thunderbird-pm-menu.png /usr/share/pixmaps/mozilla-thunderbird-pm-menu.old.png
      	#TODO: cp -f /usr/share/pixmaps/mozilla-thunderbird-pm-menu.svg /usr/share/pixmaps/mozilla-thunderbird-pm-menu.old.svg
      	cp -f /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm /usr/share/pixmaps/mozilla-thunderbird-pm-menu.old.xpm
      
      	#Divert
      	if [ "$divert" -gt "0" ] ; then
      		dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-pm.png >/dev/null
      		#TODO: dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-pm.svg >/dev/null
      		dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-pm.xpm >/dev/null
      		dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-pm-menu.png >/dev/null
      		#TODO: dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-pm-menu.svg >/dev/null
      		dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm >/dev/null
      	fi
      
      	#Replace icons
      	cp $TMP_DIR"mozilla-thunderbird-pm.png" /usr/share/pixmaps/mozilla-thunderbird-pm.png
      	#TODO: cp $TMP_DIR"mozilla-thunderbird-pm.svg" /usr/share/pixmaps/mozilla-thunderbird-pm.svg
      	cp $TMP_DIR"mozilla-thunderbird-pm.xpm" /usr/share/pixmaps/mozilla-thunderbird-pm.xpm
      	cp $TMP_DIR"mozilla-thunderbird-pm.png" /usr/share/pixmaps/mozilla-thunderbird-pm-menu.png
      	#TODO: cp $TMP_DIR"mozilla-thunderbird-pm.svg" /usr/share/pixmaps/mozilla-thunderbird-pm-menu.svg
      	cp $TMP_DIR"mozilla-thunderbird-pm.xpm" /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm
      	echo -n "."
      fi
      
      
      echo " done !"
      
      
      #Reload gnome-panel (Gnome) or kicker (KDE)
      echo -en "\nShall I reload the panel to apply the changes (y/n)? [y] "
      if [ `readyn` -ne 0 ] ; then
      	killall gnome-panel >/dev/null 2>&1
      	killall kicker >/dev/null 2>&1
      fi
      
      
      rm -rf $TMP_DIR
      exit 0
    • Save the file and close the text editor.
    • Allow execution:
      Code:
      $ sudo chmod +x /usr/local/bin/restore_mozilla_icons
    • Run the script:
      Code:
      $ sudo restore_mozilla_icons
    • Your icons are back !



    Known bugs:
    • If you create a launcher on the desktop (or copy the one in the menu to the desktop), the icon may be bigger than the others (example). If so, right click on the desktop icon, choose "Stretch icon" and resize it to the appropriate size.



    Upgrade note:
    • You may get the following message if you upgraded the script and did the package divert again:
      Code:
      dpkg-divert: rename involves overwriting `/usr/share/firefox/icons/default.xpm.distrib' with different file `/usr/share/firefox/icons/default.xpm', not allowed
      dpkg-divert: rename involves overwriting `/usr/share/firefox/icons/document.png.distrib' with different file `/usr/share/firefox/icons/document.png', not allowed
      In this case, you need to delete the two .distrib files to get it work:
      Code:
      $ sudo rm /usr/share/firefox/icons/default.xpm.distrib
      $ sudo rm /usr/share/firefox/icons/document.png.distrib
      Then run the script again.
    Last edited by Sam; November 13th, 2006 at 01:15 AM. Reason: Edgy compatibility notice

  2. #2
    Join Date
    Jun 2006
    Beans
    2,310
    Distro
    Ubuntu 14.04 Trusty Tahr

    Talking Re: SCRIPT: Take back the Firefox & Thunderbird icon

    Excellent script! Kudos! =D>

  3. #3
    Join Date
    Apr 2006
    Beans
    18

    Re: SCRIPT: Take back the Firefox & Thunderbird icon

    Nice one dude !

  4. #4
    Join Date
    Apr 2006
    Location
    Alberta,Canada
    Beans
    1,135
    Distro
    Ubuntu Development Release

    Re: SCRIPT: Take back the Firefox & Thunderbird logo

    wOOt!

    Thanx
    What color do Smurfs turn when you choke em?
    ____________________________

  5. #5
    Join Date
    Aug 2005
    Beans
    992

    Re: SCRIPT: Take back the Firefox & Thunderbird logo

    worked.
    thanks

  6. #6
    Join Date
    Apr 2005
    Location
    Finland
    Beans
    300
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: SCRIPT: Take back the Firefox & Thunderbird logo

    Greate script! Very well written and nice to have options. Thank you for this.

  7. #7
    Join Date
    Jun 2005
    Beans
    12
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: SCRIPT: Take back the Firefox & Thunderbird logo

    This script ROCKS!

  8. #8
    Join Date
    May 2006
    Location
    UEA, Norwich, UK
    Beans
    185

    Re: SCRIPT: Take back the Firefox & Thunderbird icon

    Very nice indeed. Is it possible to also change the picture in the bottom of the frame on Thunderbird, and the Help>About pictures too?
    Thanks

  9. #9
    Join Date
    Feb 2005
    Location
    Geneva, Switzerland
    Beans
    976

    Re: SCRIPT: Take back the Firefox & Thunderbird icon

    Thank everybody for your feedback !

    Quote Originally Posted by lwr
    Very nice indeed. Is it possible to also change the picture in the bottom of the frame on Thunderbird, and the Help>About pictures too?
    Thanks
    I think you need to compile Thunderbird from scratch to do that... But I'm not sure.

  10. #10
    Join Date
    Apr 2006
    Beans
    Hidden!
    Distro
    Ubuntu 6.06

    Re: SCRIPT: Take back the Firefox & Thunderbird logo

    How to replace the Help > About for Firefox, could be changed to work with Thunderbird:

    1) Get Linux build from Mozilla.com and save to Desktop

    2) Right click on the .tar.gz and select Extract

    4) sudo dpkg-divert --rename /usr/share/firefox/chrome/browser.jar >/dev/null

    3) sudo cp ~/Desktop/firefox/chrome/browser.jar /usr/share/firefox/chrome/browser.jar

    Looks much better
    Last edited by Chris03; July 3rd, 2006 at 07:34 AM.

Page 1 of 17 12311 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •