Electricmonk

Ferry Boender

Programmer, DevOpper, Open Source enthusiast.

Blog

GNOME/GTK hack: Smaller icon sizes

Tuesday, August 7th, 2007

Icons are freaking huge in Gnome. Since I’m not blind, I’d like them a bit smaller. Unfortunately, GNOME doesn’t seem to offer an easy way to do this.

There’s the desktop/gnome/interface/toolbar_icon_size in the gconf-editor, but it doesn’t appear to do anything, so that’s not really gonna work. Besides, I have no idea what I should set the integer too. Fortunately, we can tweak everything using GTK’s Resource files. The nice thing about this is that it works for all GTK 2.0 apps as well as Gnome apps.

Create a file .gtkrc-2.0 in your homedir, and put the following in it:

gtk-toolbar-icon-size=small-toolbar

That makes the toolbar buttons smaller, though not by much. You may not even notice it. Try starting some GNOME program with a toolbar (gedit is a good one; don’t use the File Browser (Nautilus) because it’s already loaded) to see if it’s satisfactory. If it’s not small enough for you, you can tweak it even further. Just add the following to the same file:

gtk-icon-sizes="gtk-small-toolbar=16,16"

That will make icons 16 by 16 pixels. Small enough for my tastes.

You can modify more than just the toolbar icons:

gtk-icon-sizes="\\
    gtk-menu=16,16:\\
    gtk-button=16,16:\\
    gtk-small-toolbar=16,16:\\
    gtk-large-toolbar=16,16:\\
    gtk-dnd=16,16:\\
    panel-menu=16,16:\\
    panel=16,16:\\
    gtk-dialog=16,16\\
"

You’ll have to figure out for yourself what they do though. Most should be obvious. Some don’t work anymore in newer gnome versions.

Changes you’ve made won’t affect Nautilus (the file browser, the desktop and everything else powered by Nautilus) until you restart Gnome. Maybe you could killall -HUP nautilus, but I didn’t dare try that.

The text of all posts on this blog, unless specificly mentioned otherwise, are licensed under this license.