26

Is it possible to make the color of the title bar of the active window different from the rest?

Right now it's black for all windows in my default set-up. I am unable to determine if I can start typing as I don't know which the focused window is.

1
  • Maybe someone will find that useful: for Ubuntu 20.04 I've forked and modified the original yaru theme, just clone github.com/trozen/yaru and follow install instructions in CONTRIBUTING.md
    – trozen
    Apr 29, 2020 at 8:32

4 Answers 4

23

This works for me (Ubuntu 18.04 + Gnome 3.28.1):

nano ~/.config/gtk-3.0/gtk.css

To customize the active title bar background colors use .titlebar and .backdrop (for inactive windows).

.titlebar {
    background: #3089FF;
    color:white; 
}

.titlebar:backdrop  {
    background: #777777;
    color:white;
} 

After saving the file, remember refresh gnome using this command:

setsid gnome-shell --replace
7
  • 4
    I also had a gtk-4.0 folder here, however putting it in there has no effect, 3.0 is the way to go. Thanks! You can also restart gnome shell with Alt+F2 and then typing 'r'
    – JonnyRaa
    Jun 19, 2019 at 12:05
  • 5
    To avoid any misunderstanding, on Ubuntu 18.04.1, the file ~/.config/gtk-3.0/gtk.css did not exist. You have to create the file. The configuration above does paint the active title bar (the window that has the focus) in a nice blue and the not active in grey. The text is in white. It is a good solution and IMHO better than replacing the theme Ambiance by Adwaita. Certainly a question of taste. Jan 14, 2020 at 10:06
  • @Wonko the Sane, the color of the title bar of the file manager (Nautilus) does not change and it is of course annoying. Jan 14, 2020 at 10:08
  • @RudyVissers Agreed. Perhaps someone who works on the Nautilus project can assist with that. Jan 31, 2020 at 13:43
  • This trick worked. Thanks a lot.
    – Puspam
    Feb 25, 2020 at 12:55
3

A very simple way to make the color of the title bar different, is to choose a different theme, that does take this aspect into account (why the default one doesn't, beats me).

To change the default theme, install Gnome Tweaks (sudo apt install gnome-tweaks), then choose a theme like Adwaita:

Gnome Tweaks change theme

1
  • not an answer on the question May 13, 2023 at 16:31
0

Not really a different answer but I found these colours more aesthetically pleasing under the ambience theme. I used gPick to make them match the rest of the theme (except the colours). Unfortunately you can't just leave them blank and have system defaults - that first one just applies in all cases without the second one.

This didn't work for all windows (notably chrome + some config windows) until after restarting, not sure why. Just reloading gnome shell wasn't enough.

.titlebar {
    background: #1856dd;
    color:white; 
}

.titlebar:backdrop  {
    background: #3E3D3A;
    color:#807D78;
} 

Interestingly if you leave out the 'color' bits of those, gnome shell restarts much more quickly (even if you replace white with #FFFFFF). I don't see any errors in syslog or anything obvious in journalctl so not sure why.

Without setting white it looks a bit nasty, so I added it back in!

0

To expand on other answers that suggest editing ~/.config/gtk-3.0/gtk.css.

In Ubuntu 22.04 I had to use three separate selectors to get it working in the Settings app, the text editor and Nautilus.

.titlebar works for Nautilus. headerbar works for Settings. UnityDecoration.top works for the text editor. The inactive (backdrop) style works with just two selectors.

.titlebar, headerbar, UnityDecoration.top {
    background: #0567b8;
    color:white; 
}

.titlebar:backdrop, headerbar:backdrop {
    background: #333333;
    color:#807D78;
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .