How to make active window visually stand out more in Ubuntu 18.04 Gnome 3

I would like to tweak my system so that the window under focus stands out more. The contrast in the title bar between active and inactive windows is quite hard to see.

I hit this issue the most when I have a lot of terminals open across many 30" monitors and have no idea which one currently has focus.

An ideal solution would be that the window is obvious just from the brightness of the title bar without needing to reach for the mouse or do fiddly alt-tabbing.

I've found some related questions:

How do I efficiently find my terminal window in GNOME Shell?

Gnome-terminal tabs: no contrast between active and inactive tabs

Visually recognise active window

but these are either for unity/compiz, require a mouse or are just for terminals (and it would be nice to solve this for all apps).

I have tried the "Windows Blur Effects" add on (see How to change color of the active/inactive window?) but it makes gnome very slow under its default settings and I'm unable to open the settings from the "Extensions" tab in gnome-tweak-tools to make it less heavy.

Thanks in advance.


Solution 1:

Create gtk.css file in .config/gtk-3.0/ of your home dir and paste following code.

/* Need to be adjusted to your theme. I'm using Adwaita dark theme. */
@define-color backdrop_color #2d2d2d;
@define-color standout_color seagreen;
@define-color very_standout_color yellow;

/* border around windows */
decoration {
  border: 1px solid @very_standout_color;
  background: @very_standout_color;
}
decoration:backdrop {
  border: 1px solid @backdrop_color;
  background: @backdrop_color;
}

/* title/headerbar colors */
headerbar.titlebar {
  background: @standout_color;
}
headerbar.titlebar:backdrop {
  background: @backdrop_color;
}

It tries to:

  1. add 1px border around windows
  2. color titlebar/headerbar.

It's not excellent for all applications and windows but for me (gnome 3.38.2) it's enough to quickly distinguish active window. Even if some application's window do not color headerbar correctly, an accented border is visible.

Sometimes it is good to adjust an application's preferences to better highlight it. E.g. Firefox has titlebar disabled by default and without enabling it tab bar and address bar are always colored with accented color. I enabled titlebar and shrink titlebars according to this. In applications having themes it's usually better to set default/system theme.

Some changes require logout/in or reboot to take effect, so remember to do it after every change in the css file to see the results.