Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to change the background color of the menu bar in Ubuntu but no luck.

My current theme is Ambiance.

I've tried to change the file named gtkrc in the Ambiance theme folder but no luck.

Any ideas on how I can do this?

share|improve this question
    
Unless I'm mistaken, gtkrc is only used to setting up the theme for GTK+2 applications, while Unity gets its theming from GTK+3. Your desired settings are probably located in another file. –  WarriorIng64 May 12 '12 at 18:08
    
Yes you're right. I found out that the correct folder to edit the style from was inside gtk-3.0 of the themes folder. Thanks for your comment. Since I'm a new user on askubuntu I'm unable to answer my own questions until 8hrs have passed since posting the question, but once this 8hrs has passed I'll go ahead and post this as the answer. Until then, I've edited to question to show the correct answer. –  Nej Kutcharian May 12 '12 at 18:12

3 Answers 3

up vote 4 down vote accepted

If you're aware of CSS than you would have a greater control over color and style of the top panel. Following is how you can do it with Ambiance theme.

  • Open Nautilus as root, since you'll be backing up and editing files.

    gksu nautilus

  • From here, make sure all file operations that you do are from this instance of nautilus that you opened using command.

  • Navigate to /usr/share/themes/Ambiance/gtk-3.0/apps directory

    • Before you do anything, make copy of files unity.css and gnome-panel.css in the directory to somewhere in your home folder so that if you mess up anything, you can revert back the changes easily.
  • Since you want to change color of top panel in Unity, open unity.css for editing in a text-editor (gedit).

  • Now create CSS variable as follows at the topmost of the file

    @define-color dark_bg_color #DCDCDC;
    @define-color dark_fg_color #3f3f3f;
    
  • Note that variable dark_bg_color indicates the panel background color you want to have, set its value with the hashcode of the color you want.

  • Similarly, variable dark_fg_color indicates foreground color i.e. font color of the panel items, set it with hashcode the value you want.

  • Finally, save the file and exit. Logout, and login again, and changes you made should be visible. You can modify the values as you want, and in case you want to get back default panel color of Ambiance back, just open Nautilus as root and replace file unity.css with the one you backed up earlier.

While above mentioned method can be used to tweak color of Unity top panel, you can make similar changes in gnome-panel in GNOME classic, by making similar changes in file gnome-panel.css.

The steps I gave above might sound a bit complicated but they're pretty easy than styling any OS (AKA Windows) you think. Explore possibilities here :-)

share|improve this answer

You could edit an appropriately sized bar of the color you want onto your wallpaper in the GIMP and then set the transparency higher. I don't know if there is an easier way or not.

share|improve this answer

OP Posted:

It turned out I was on the right track before. The file I was editing was located inside gtk-2.0 but I'm assuming in ubuntu 12.04 they moved onto gtk-3.0.

In short, if you want to edit the style of the panels, they're located inside:

/usr/share/themes/"your theme name"/gtk-3.0
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.