Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] get normal thunderbird and firefox icons in taskbar
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
johnmiked15
n00b
n00b


Joined: 13 Oct 2004
Posts: 12
Location: United States

PostPosted: Tue Jun 14, 2005 4:40 am    Post subject: [HOWTO] get normal thunderbird and firefox icons in taskbar Reply with quote

I got this script over at the Ubuntu forums:
http://ubuntuforums.org/showthread.php?t=34354

I modified it to work with Gentoo. Since the program icons in /usr/share/pixmaps are already the normal ones, this script just replaces the icons in the /usr/lib/MozillaFirefox and /usr/lib/MozillaThunderbird so that the correct icon displays in the taskbar.

It requires imagemagick to create the small mozicon16.xpm file because the script still downloads the icon pack from the ubuntuforum download site, and it doesn't include a small one.

copy and paste this into /usr/local/restore_mozilla_icons:
Code:
#! /bin/sh

#
# Restore the original Firefox and/or Thunderbird icons.
#

FIREFOX_BIN="/usr/bin/firefox"
THUNDERBIRD_BIN="/usr/bin/thunderbird"

ICON_PACK_URL="http://ubuntuforums.org/attachment.php?attachmentid=1113"

ROOT_UID="0"

TMP_DIR="/tmp/moz-icons"$$"/"


#Ctrl-C trapping
trap ctrlc INT
ctrlc()
{
        echo -e "\nAborted by user."
        rm -rf $TMP_DIR
        exit 2
}


#Check if run as root
if [ "$UID" -ne "$ROOT_UID" ] ; 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"

if [ -x "$FIREFOX_BIN" ] ; then
        #Firefox
        echo -n "Replace the Mozilla Firefox program icon (y/n)? [y] "
        read input
        if [ -z "$input" ] || [ "$input" == "y" ] || [ "$input" == "yes" ] || [ "$input" == "Y" ] || [ "$input" == "YES" ] ; then
                replace_ff="1"
        fi

        #Firefox document
        echo -n "Replace the Mozilla Firefox document icon (y/n)? [y] "
        read input
        if [ -z "$input" ] || [ "$input" == "y" ] || [ "$input" == "yes" ] || [ "$input" == "Y" ] || [ "$input" == "YES" ] ; then
                replace_ff_doc="1"
        fi
fi

if [ -x "$THUNDERBIRD_BIN" ] ; then
        #Thunderbird
        echo -n "Replace the Mozilla Thunderbird program icon (y/n)? [y] "
        read input
        if [ -z "$input" ] || [ "$input" == "y" ] || [ "$input" == "yes" ] || [ "$input" == "Y" ] || [ "$input" == "YES" ] ; then
                replace_tb="1"
        fi
fi

if [ "$replace_ff" -eq "0" ] && [ "$replace_ff_doc" -eq "0" ] && [ "$replace_tb" -eq "0" ] ; then
        echo "Nothing to do here."
        exit 0
fi

#Downloading
echo -en "\nDownloading and replacing icons. Please wait..."

mkdir $TMP_DIR
wget $ICON_PACK_URL -O $TMP_DIR"mozilla_icons.tar.gz" >/dev/null 2>&1
if [ ! -f $TMP_DIR"mozilla_icons.tar.gz" ] ; then
        echo -e "\nCannot download icons. Please check your internet connection."
        rm -rf $TMP_DIR
        exit 1
fi
tar zxf $TMP_DIR"mozilla_icons.tar.gz" -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 --reply=no /usr/lib/MozillaFirefox/icons/mozicon50.xpm /usr/lib/MozillaFirefox/icons/mozicon50.old.xpm
        cp --reply=no /usr/lib/MozillaFirefox/icons/mozicon16.xpm /usr/lib/MozillaFirefox/icons/mozicon16.old.xpm
        cp --reply=no /usr/lib/MozillaFirefox/chrome/icons/default/default.xpm /usr/lib/MozillaFirefox/chrome/icons/default/default.old.xpm

        #Replace icons
        cp $TMP_DIR"mozilla-firefox.xpm" /usr/lib/MozillaFirefox/icons/mozicon50.xpm
        convert /usr/lib/MozillaFirefox/icons/mozicon50.xpm -geometry 16x16 /usr/lib/MozillaFirefox/icons/mozicon16.xpm
        cp $TMP_DIR"mozilla-firefox.xpm" /usr/lib/MozillaFirefox/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 --reply=no /usr/lib/MozillaFirefox/icons/document.png /usr/lib/MozillaFirefox/icons/document.old.png

        #Replace icons
        cp $TMP_DIR"mozilla-firefox-doc.png" /usr/lib/MozillaFirefox/icons/document.png
        echo -n "."
fi


#Replace Thunderbird icon
if [ "$replace_tb" -gt "0" ] ; then
        if [ ! -f $TMP_DIR"mozilla-thunderbird.xpm" ] ; then
                echo "Cannot continue (unavailable Thunderbird icon file)"
                rm -rf $TMP_DIR
                exit 1
        fi

        #Backup
        cp --reply=no /usr/lib/MozillaThunderbird/chrome/icons/default/default.xpm /usr/lib/MozillaThunderbird/chrome/icons/default/default.old.xpm
        cp --reply=no /usr/lib/MozillaThunderbird/chrome/icons/default/messengerWindow16.xpm /usr/lib/MozillaThunderbird/chrome/icons/default/messengerWindow16.old.xpm
        cp --reply=no /usr/lib/MozillaThunderbird/chrome/icons/default/messengerWindow.xpm /usr/lib/MozillaThunderbird/chrome/icons/default/messengerWindow.old.xpm

        #Replace icons
        cp $TMP_DIR"mozilla-thunderbird.xpm" /usr/lib/MozillaThunderbird/chrome/icons/default/default.xpm
        cp $TMP_DIR"mozilla-thunderbird.xpm" /usr/lib/MozillaThunderbird/chrome/icons/default/messengerWindow16.xpm
        cp $TMP_DIR"mozilla-thunderbird.xpm" /usr/lib/MozillaThunderbird/chrome/icons/default/messengerWindow.xpm
        echo -n "."
fi


echo " done !"

rm -rf $TMP_DIR
exit 0


Make it executable and run.
Back to top
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Wed Jun 15, 2005 12:50 am    Post subject: Reply with quote

You could also copy the Firefox/Thunderbird ebuilds into your overlay and edit them to add "--enable-official-branding" as an option to the configure script.
_________________
~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Back to top
View user's profile Send private message
Mattwolf7
n00b
n00b


Joined: 14 Mar 2004
Posts: 73

PostPosted: Thu Jun 16, 2005 12:49 am    Post subject: Reply with quote

Shouldn't this be a use flag?
Back to top
View user's profile Send private message
codergeek42
Bodhisattva
Bodhisattva


Joined: 05 Apr 2004
Posts: 5142
Location: Anaheim, CA (USA)

PostPosted: Thu Jun 16, 2005 1:11 am    Post subject: Reply with quote

Mattwolf7 wrote:
Shouldn't this be a use flag?
No. Due to artwork licensing and trademark issues, the official Mozilla icons can only be distributed alongside official Mozilla builds of Firefox/Thunderbird.
_________________
~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum