Wednesday, May 26, 2010

Change Gnome Panel Text Color

When using Gnome as your desktop environment, there are many ways to allow this. One way is to make the Gnome panels transparent. The way to do this is to right-click on top of the panel. Select properties. Check the radio button that says Solid color. Below that, where it says style, slide the bar all the way to the left, (where it says transparent). Now the panel is transparent instead of a solid color. The desktop wallpaper will blend in with it. Looks cool, huh?
However, there is a problem with this sometimes. The default text color for the Gnome panel is black, or #000000 in geek language.
Don’t worry kiddies, I have the fix!
This fix requires a simple hack as follows:
Open the terminal and type:
gedit .gtkrc-2.0
Insert the following into this file
style “panel”
{
# fg[NORMAL] = “#ffffff”
# fg[PRELIGHT] = “#000000″
# fg[ACTIVE] = “#ffffff”
# fg[SELECTED] = “#000000″
# fg[INSENSITIVE] = “#8A857C”
# bg[NORMAL] = “#000000″
# bg[PRELIGHT] = “#dfdfdf”
# bg[ACTIVE] = “#D0D0D0″
# bg[SELECTED] = “#D8BB75″
# bg[INSENSITIVE] = “#EFEFEF”
# base[NORMAL] = “#ffffff”
# base[PRELIGHT] = “#EFEFEF”
# base[ACTIVE] = “#D0D0D0″
# base[SELECTED] = “#DAB566″
# base[INSENSITIVE] = “#E8E8E8″
# text[NORMAL] = “#161616″
# text[PRELIGHT] = “#000000″
# text[ACTIVE] = “#000000″
# text[SELECTED] = “#ffffff”
# text[INSENSITIVE] = “#8A857C”
}
widget “*PanelWidget*” style “panel”
widget “*PanelApplet*” style “panel”
class “*Panel*” style “panel”
widget_class “*Mail*” style “panel”
class “*notif*” style “panel”
class “*Notif*” style “panel”
class “*Tray*” style “panel”
class “*tray*” style “panel”
Next, uncomment the part that says:
# fg[NORMAL] = “#ffffff”
So it looks like:
fg[NORMAL] = “#ffffff”
Save this file. It will be saved as .gtkrc-2.0 in your home directory. You do not need to do save as, unless your terminal is opened in another directory besides your home directory.
Or as an easy alternative, you may also just use this file. Right click and choose save as, and name the .gtkrc-2.0. You will want to make sure that this is downloaded to your home folder, by the way.
Note: you will not see this file in normal view. The “.” in front of the filename makes the file hidden. You can see all of your hidden files in Nautilus by selecting view -> show hidden files.
To explain, the #ffffff represents the color white. You can change this to whatever color you want. Gcolor2 is a great color chooser for Gnome. Ubuntu users will find this in universe:
sudo apt-get install gcolor2
The change desktop background dialog will also work to select this color notation, if you do not want to install gcolor2.
All we need to change is:
fg[NORMAL] = “#ffffff”
to allow our Gnome panel to have a different text color besides black (#000000), which is the default. The rest of the lines in this are out of the scope of this solution. However, they are useful for other things which will not be discussed for this post.
The last step is to refresh the Gnome panel:
killall gnome-panel
Responses to “Change Gnome Panel Text Color”
The code I used was:
include “/home/autocrosser/.gnome2/panel-fontrc”style “desktop-icon”
{
NautilusIconContainer::frame_text = 1
text[NORMAL] = “#9203c1″
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”