Mark Sanborn Mark Sanborn Fishing Mark Sanborn

Coder, Entrepreneur, Blogger, and Coffee Addict

Speed up the Gnome Menu and Fix the Annoying Icon Delay

Recently I installed a copy of Ubuntu Feisty Fawn 7.04 on an older computer and I noticed that the Gnome menu was slow and the icons next to the menu items were taking a few seconds to load. At first I attributed this to the old slow computer. I later went home and booted up my new dual core system with 2gigs of RAM and noticed the same problem. At this point I knew that there was something wrong.

The first problem with the Gnome menu is that it loads the menu icons as needed causing a delay before you can see the icons. By default when you click the Gnome menu the icons are retrieved and loaded after the click (this is why there is a delay) and put in memory so they can be called later. Once the icons are in memory there will be no delay the next time you go to the same menu item. However, I think this is a bug since you should never see a delay in a menu system even if it is the first time you click on it. You can fix this problem by typing the following command as root.

gtk-update-icon-cache -f /usr/share/icons/THEMENAME/

Remember to replace the THEMENAME with the actual icon theme set you are using. The default is ‘gnome‘.

The second problem I find with the Gnome menu is that it as a built in delay before sub menus are generated when you hover over them with your mouse. Unlike the ‘bug’ I described before this one is actually a feature :) . Many users don’t want the sub navigation menu popping out as they are moving their mouse down the list to their final destination. The only problem is the delay is too slow by default and I recommend speeding it up a bit. You can do that with the following command.

echo gtk-menu-popup-delay = 100 >> ~/.gtkrc-2.0

If this speeds up the menu too much or not enough you can modify the speed by opening up the file .gtkrc-2.0 in your home directory and change the ’100′ to a smaller number (faster) or a larger number (slower). You can do this with your favorite text editor or Nano text editor if you don’t have a favorite :) .

nano -w ~/.gtkrc-2.0

This tweak should work on all distributions of linux.

So far I have tested it on Ubuntu Feisty Fawn 7.04.

For another performance tweak you can also Turn Off Gnome Animations and Hide Window Contents While Dragging. This is especially useful for older machines or servers.



This entry was posted in Linux. Bookmark the permalink.

20 Responses to Speed up the Gnome Menu and Fix the Annoying Icon Delay

  1. Jade Robbins says:

    Are there supposed to be php tags around those?

  2. Mark Sanborn says:

    heh, of course not… I accidentally left them in there when I did the code tag for wordpress. Thanks for catching that.

  3. Jade Robbins says:

    No problem. Had me a little confused there :D

  4. Dakkar says:

    Hello, is there a way to know what Icon theme I’m using, I looked at the theme manager and my icon theme name is OSX but I don’t see any folder with that name under /usr/share/icons, could be in another location?

    Thanks in advance

  5. Don says:

    awesome simple fix. another great reason open source excels while windows continually stumbles

  6. Mark Sanborn says:

    Dakkar, It could be under /~/.icons That is where I store my personal themes I download. It is hard to say where you stored it. You can re-install it in System > Preferences > Theme. You can also specify the icon set in customize.

    If you are sure the theme name was OSX and you think the file name might have osx in it do a search with:

    updatedb
    slocate osx

    Hope this helps.

  7. John says:

    Trying to do the icon cache thing.. It claims there is no theme index file when I point it to the folder where my icon set is located, yet there _is_ an index.theme file. Hmmmm…

  8. Mark Sanborn says:

    John,

    That is interesting I have never gotten that error before are you sure you are typing in the correct path to the theme?

    Can you touch the index.theme file?

    Mark

  9. John says:

    Hi, Thanks for the response.

    Pretty certain I have the correct path. What do you mean by touch the index.theme file?

    This is the error I get:

    No theme index file in ‘/home/John/.icons/leopard-icons/’.
    If you really want to create an icon cache here, use –ignore-theme-index.

  10. Mark Sanborn says:

    Try,

    gtk-update-icon-cache -f -ignore-theme-index /home/John/.icons/leopard-icons/

    and see if that speeds up the menus. The touch command modifies the file modified date to current date. This command is useful in determining if the file is there and can be altered.

  11. John says:

    Ok, so turns out I did have the incorrect path. Shouldn’t have capitalized the J in John. So I ran the correct command:

    gtk-update-icon-cache -f /home/john/.icons/leopard-icons/

    But I got this:

    The generated cache was invalid.

  12. Mark Sanborn says:

    Yeah, you have to be careful in Linux everything is case sensitive. One tip I can give is use the tab key for completing file paths in the command line as it will not make mistakes.

    Try running:

    gtk-update-icon-cache -f /usr/share/icons/gnome/

    Just to make sure you can run the command. You may have an icon pack that is referencing files(icons) that aren’t there causing an invalid cache.

  13. John says:

    Oh, now that you mention it, I did replace some icons myself awhile back, but I used the same file names as the old ones.

    You sure know your icons. ;)

    This command worked fine:

    gtk-update-icon-cache -f /usr/share/icons/gnome/

    Looks like it will be complicated to cache my altered leopard-icons set, since I did play around with them previously.

  14. Mark Sanborn says:

    John,

    Yeah you may want to start with the original pack and make sure that all the files replaced are the exact same name. It can be kinda tricky making your own sets of icons. But on the other hand it can be rewarding having cool icons to look at. :)

    I guess you will have to decide to have a slow menu or take the time to make a custom icon pack that will cache.

    Glad I was able to steer in the right direction anyways. :)

  15. John says:

    Thanks a ton!

  16. mael says:

    thanks!

  17. GNUbie says:

    Thanks for this tips! I’ve been bothered by this quite some time but always was to lazy to sort it out. Now I decided to do some googlin’ and here I am. Another satisfied customer! Merry Xmas to you Sir! Thanks again.

  18. Mark Sanborn says:

    Merry Xmas to you too!

  19. Great tip. And it motivated me to figure out how to restore my missing menu icons too!

  20. gareth says:

    To update all icons:
    for d in /usr/share/icons/*; do gtk-update-icon-cache -f $d; done

    With sudo:
    for d in /usr/share/icons/*; do sudo gtk-update-icon-cache -f $d; done

    Another option:
    for d in /home/gareth/.icons/*; do gtk-update-icon-cache -f $d; done

    Obviously “gareth” has to be replaced with your own username. And sudo should be added if needed.

    I stole the code from the comments on this page:
    http://hughsient.livejournal.com/12033.html

© 2011 All rights reserved

1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216| generic buying erythromycin alesse next day delivery without a prescription motilium no prescription needed buy cytotec pills canadian pharmacy no prescription needed provera actos by internet buying orlistat pharmacy without prescription lisinopril no prescription needed purchase femara medication buy lipitor cod actonel buy online cheap buy carbozyne online without prescription femara prescription discounts elavil without prescriptions pills buying isotretinoin online pharmacy trazodone no prescription order no prescription metformin birth control no prescriptionAccutane Online Doxycycline online Buy Cheap Lexapro Online No Prescription Prednisone Online Buy Accutane No Prescription