11 Comments

Changing Gnome Panel Font Color

Update: Since I jotted this post, I have learned that their is a GUI utility that can do this called Gnome Color Chooser and wrote about it in Gnome Panel Font Color Part Deux.

Gnome appearance has come a long long way in the last year. What used to take several control panels to change the look of the Desktop has been combined into a very nice MacOS9-like Appearance control panel. And since 2.20 users can specify custom colors for themes- Vaaarry Niiiice. There are a couple bits remaining that would be nice to be able to customize including the panel. Gnome-panel does not have theme support as of Gnome 2.20 but this is planned for a future revision – 2.26? Gnome panel does have built in support to change it’s background color but not the font color, so darker colors tend to wash out the black font.

Gnome-panel font color can be changed though through a custom defined gtk theme file ~/.gtkrc-2.0. The following template can be edited to do this. Use your favorite text editor and and either add to or create ~/.gtkrc-2.0.

vim ~/.gtkrc-2.0
include "panel-fontrc"style "desktop-icon"

{
    NautilusIconContainer::frame_text = 0
    text[NORMAL] = "#000000"
    NautilusIconContainer::normal_alpha = 70
}
class "GtkWidget" style "desktop-icon"

#NautilusIconContainer::dark_info_color="#888888"
#NautilusIconContainer::light_info_color="#bbbbbb"
#NautilusIconContainer::highlight_alpha=200

style "my_color"
{
    fg[NORMAL] = "#ffffff"
}
widget "*PanelWidget*" style "my_color"
widget "*PanelApplet*" style "my_color"
widget_class "*MenuItem*" style "my_color"
widget_class "*ToolItem*" style "my_color"
widget_class "*SeparatorMenuitem*" style "my_color"
widget_class "*SeparatorToolitem*" style "my_color"
widget_class "*ImageMenuitem*" style "my_color"
widget_class "*RadioMenuitem*" style "my_color"
widget_class "*CheckMenuitem*" style "my_color"
widget_class "*TearoffMenuitem*" style "my_color"

The code "fg[NORMAL] = "#ffffff" is what controls the panel font color.

Now pick you favorite hex color (#ffffff) with Gimp or you can use the color picker in the Appearance Control Panel.

Additionally you can define the Menu text color ( File Edit … ) with the *MenuItem* value. Gtk will spit out an error that it doesn’t like this but it’s not fatal.

To see the change kill gnome-panel (gnome-session will automatically start it up again):

killall gnome-panel
About these ads

About Gen2ly

<3's linux

11 comments on “Changing Gnome Panel Font Color

  1. Nice tip but have you tried Gnome Color Chooser?

  2. huh? never heard of it. Looks like it edits the .gtkrc-2.0 file too. I’ll give it a try.

  3. Hey mate,

    I tried this and had some modicum of success; success is sweet, so any amount is good.

    It would be nice for a noob like myself to have a list of things that can be changed, and what they actually are in “human readable” form so we can choose exactly what we want to change and how.
    I expect that ‘ widget_class “*MenuItem*” ‘ refers to the text of a menu item in a drop-down menu list, but I have no idea what ‘ widget_class “*TearoffMenuitem*” ‘ refers to. Is there a simple list of this stuff somewhere, perhaps even in your files somewhere?

    Incidentally, I tried to install gnome-color-chooser”, but dependencies let me down in a big way, and the whole thing failed. From the terminal output during the install process, it appears that the “latest” libraries of various types installed on my machine are incompatible with the “latest” version of g-c-c; the installation appears to have wanted older versions of the libraries. How odd!

    Anyways, I’m happy to use terminal, but I could do with a “glossary” of what all the widgets, applets, classes, etc are. I am the kind of user that goes to a retailer, buys a computer, plugs it in and “away we go”, not a developer, programmer or geek. But I’m willing to learn. I’ve abandoned Linux several times over the last ten years, but I’m determined to master it this time around. I’m using Ubuntu Gutsy.

    Cheers,
    Steve

  4. Definitely good to hear a user learning Linux’s more technical side! I agree that the syntax is discouraging to any that haven’t seen it (myself included) and could be put in better readable format. Basically I’ve discovered in Linux that most programs are in a state of flux and that many thoughts get coded but not implemented. This is the instance in this particular case. GTK bindings that haven’t and may not find a place in Gnome.

    I have installed the newest gcc so I have no idea what libraries is being referred to. I did find a color choose deb here:

    http://3v1n0.tuxfamily.org/pool/edgy/3v1n0/gnome-color-chooser_0.1.3-3v1ubuntu0_i386.deb

    Gnome Colorchooser is good for this task. I found a deb for it here:

    http://3v1n0.tuxfamily.org/pool/edgy/3v1n0/gnome-color-chooser_0.1.3-3v1ubuntu0_i386.deb

    As for the definitions, I generally don’t talk code here Steve. I know alot of experience developers on Ruby on Rails. I know they have good programmers there.

    http://www.rubyonrails.com/

  5. thank you i’m impressed

    i have tried all the day to install gnome-color-chooser whit a lot of errors, this script its just what i’ve loocking for

    saludos desde Chihuahua, México.

    oce76@hotmail.com

  6. I am having trouble finding the gtkrc file. I manged to find a gtkrc file under my /home//.themes//gtk2.0 directory, but the structure of the file is not matching what you have provided.

    Pardon me for a complete newbie, but do I do a vim ~/.gtkrc-2.0 to create a new file instead?

  7. Definitely. If the file doesn’t exist, a new one will have to be created.

    “gedit ~/.gtkrc-2.0″ may be the better option if one hasn’t tried vim before.

  8. Thank you for the tip.

  9. Martyn Parker :
    Nice tip but have you tried Gnome Color Chooser?

    Great!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 51 other followers

%d bloggers like this: