HOWTO: Mintify Icon Themes

Write tutorials here
There are more tutorials here
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Level 1
Level 1
Posts: 48
Joined: Thu Mar 20, 2008 3:40 pm

HOWTO: Mintify Icon Themes

Postby ranyardm » Wed Apr 16, 2008 11:17 am

Okay, it really bugs me when I'm looking at themes that the Ubuntu icon comes back, so I decided that I'd look at scripting a "fix icon theme" script. I know it's fixed in mintmenu 3.1 but I guess there's other things that will look for start-here.png and novell.png etc. so it may retain usefulness to fix here anyway.

Guess what, it worked! If only text attachments worked in phpBB I'd be able to post it here... and my mintupload isn't working either, *sigh*,

Steps to use :
Download my script above and save somewhere you know where it is (/tmp/ or your home directory is good)
Open up "Appearance" from the Control Center or Preferences in the MintMenu
Drag your icon theme straight from firefox into the window (or download and install etc.)
Apply a theme other than the theme you want fixing and exit Appearance
Open a terminal and run the script themename (you may need sh before if you don't know how to make the script executable)
Re-open "Appearance" and viola, selecting the theme will maintain your mint logo!

What the script does :

Looks at the "Cassandra" icon set that is on Daryna also, copies the .png files to the same place in the user's theme and edits the theme index file to include any missing directory definitions (yes, most themes have wildly different indexes to what is really there!)

I hope this helps someone. Oh, and it's GPL/BSD/Copyleft/Any other reasonable license multi-licensed.
Martyn Ranyard

Level 23
Level 23
Posts: 18703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: HOWTO: Mintify Icon Themes

Postby Husse » Fri Apr 18, 2008 5:33 pm

If only text attachments worked in phpBB I'd be able to post it here

You could include it in a code box such as

Code: Select all


REPLACE_FILES="distributor-logo.png gnome-main-menu.png novell-button.png start-here.png"

if [ -z $DESTINATION_THEME ] || ! [ -d ~/.icons/$DESTINATION_THEME ]; then
  echo "Usage : [sh] \"[theme name to mintify]\""
  echo ""
  echo "Mintifyable themes : "
  echo ~/.icons/* | sed s/"\/[^ ]*\/"//g
  exit 0

SOURCE_SIZES=`echo $SOURCE_SIZES | sed s/"\/[^ ]*\/"//g | sed s/" "/"\n"/g | sort -r -n`

echo Source Sizes = $SOURCE_SIZES

for s in $SOURCE_SIZES; do
  mkdir -p ~/.icons/$DESTINATION_THEME/$s/places
  for f in $REPLACE_FILES; do
    if [ -e /usr/share/icons/$SOURCE_THEME/$s/places/$f ]; then cp /usr/share/icons/$SOURCE_THEME/$s/places/$f ~/.icons/$DESTINATION_THEME/$s/places/; fi

ORIGDIRS=`grep ^Directories ~/.icons/$DESTINATION_THEME/index.theme | sed s/^Directories=//`
for s in $SOURCE_SIZES; do
  if ! echo $ORIGDIRS | grep $s/places > /dev/null; then

NEWDIRS=`echo $NEWDIRS | sed s/,\$//`
LINECOUNT=`wc -l ~/.icons/$DESTINATION_THEME/index.theme | sed s/" .*"//`
DIRECTORIES_LINE=`grep -n Directories= ~/.icons/$DESTINATION_THEME/index.theme | sed s/:.*//`

echo Creating minted theme index...
echo "Directories=$ORIGDIRS,$NEWDIRS" | sed s/,\$// >> $MINTEDTHEMEINDEX
for s in $SOURCE_SIZES; do
  if ! grep "\[$s\/places\]" $SOURCETHEMEINDEX > /dev/null; then
    echo "" >> $MINTEDTHEMEINDEX
    echo "[$s/places]" >> $MINTEDTHEMEINDEX
    echo "Size="`echo $s | sed s/"x.*"//` >> $MINTEDTHEMEINDEX
    echo "Context=Places" >> $MINTEDTHEMEINDEX
    echo "Type=Scaled" >> $MINTEDTHEMEINDEX
echo Backing up original theme index...
mv ~/.icons/$DESTINATION_THEME/index.theme ~/.icons/$DESTINATION_THEME/index.theme.orig
echo Minting....
mv ~/.icons/$DESTINATION_THEME/index.minted ~/.icons/$DESTINATION_THEME/index.theme
echo Done.
Don't fix it if it ain't broken, don't break it if you can't fix it

Return to “Tutorials”