17

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.

rmin
  • 343

3 Answers3

10

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.

  • On Linux Mint I only see the yellow border on notifications and on menus when I right click – aless80 Mar 17 '22 at 08:58
  • For me on Gnome 42.2 it is sufficient to set headerbar and headerbar:backdrop, omitting .titlebar. – Big McLargeHuge Jul 19 '22 at 22:49
  • Kinda works. Not works for most apps, currently I only see the border on Tilix (terminal) and nothing else. – RVFET Aug 22 '24 at 08:57
  • @RVFET It is likely that the other apps on your system are using GTK 4.0, while Tilix is using GTK 3.0. You can try adding a similar file to ~/.config/gtk-4.0/gtk.css to see whether the style rules take effect for the other apps. – Ian Mackinnon Apr 23 '25 at 12:10
1

I use the extension https://extensions.gnome.org/extension/4699/highlight-focus/

It highlights the focussed window with a temporary border.

0

For GTK4 from internet search:

@define-color backdrop_color @theme_selected_bg_color;
@define-color very_standout_color alpha(@theme_fg_color, .125);
decoration {
  border: 1px solid @very_standout_color;
  background: @very_standout_color;
}
decoration:backdrop {
  border: 1px solid @backdrop_color;
  background: @backdrop_color;
}
Sergei G
  • 111