Gnome Tweak: Custom Window Borders

Little quality of life things on the desktop

Posted by Chris on Wed, May 14, 2025

I am a floating/stacking window manager type of person and I use Gnome as my desktop environment lately (v48.1 currently).

When there are a lot of windows open that are predominately dark, blank space and they overlap one another it is easy to lose where one window ends and where another begins with the default Gnome theme. Think of having a dozen overlapping terminal windows open on one desktop when using the dark theme in Gnome. Where do I click to raise this window? Where did that other window go? That kind of thing. The tiling window manager people are now screaming at their monitors! My application windows have to be the size I determine, not shrank or stretched to match some percentage of the existing screen - so there! Ha!

My experience is that Gnome doesn’t respond well to theming when using a lot of the canned themes that are out there. Mostly it’s because they are out of date or they are just, how to say it diplomatically, some are not easy on the eyes.

I’ve tried some other themes that do work but they always left something to be desired. And the default theme that Gnome v48 ships with is very good other than this one quibble I have with it.

So, what to do?

Apparently, it’s easy enough to extend the default gnome theme by adding some CSS to the file ~/.config/gtk-4.0/gtk.css. Adding code there doesn’t modify the ‘as shipped’ theme and it should survive Gnome updates over time.

Here is what I added to the bottom of the file initially:

decoration {
    border: 2px solid grey;
    background : grey;
}

For good measure it makes sense to do the same thing for GTK3 theming in ~/.config/gtk-3.0/gtk.css.

This changes the default border colour from black to grey and gives the edges of the windows more contrast and visibility. After a while I found it to be a bit much so I opened the colour picker tool in GIMP and selected a darker grey with a slight shade of orange (#5c4f4a) that kind or aligns with my Gnome “Accent Color” that I use (orange). I’ll probably mess around with this a little more but it suites my purposes for today.

If you’d like to comment, I posted on Mastodon.

gnome_tweak_desktop_with_borders_2025-05-14.jpg