[u-u] window borders in gnome/gtk

Dan Astoorian djast at ecf.utoronto.ca
Mon Apr 27 10:53:09 EDT 2020

On Mon, 27 Apr 2020 09:52:52 EDT, Jim Mercer writes:
> in both cases, it spins up a window with a black background, a scrollbar on t
> he
> right, and no other decoration (well, a title bar on top).
> the problem is that when i have multiples of these over-lapping, i can't see
> where the overlap is, and i end up typing in the wrong window.
> i tried googling around about how to add borders, but, it ends up taking me
> to some .css file or XML file, and, i'm just lost with that stuff.
> is there a less mystifying way to add a border to all 4 sides (or at least le
> ft/right/bottom)?
> --jim

I assume by "Ubuntu 18" you mean 18.04 LTS, which is also what I'm

There is a very thin border; it's just too dark to see against the black
window.  (I think the border is actually semi-transparent.  Imagine
looking at a black wall through grey tinted sunglasses: you're still
going to see black.)

I'll assume that you're not willing to solve the problem with
"pterm -bg white -fg black" or something similar.

In GNOME 3, window appearance is mostly controlled via themes, although
after a quick search I haven't managed to find any themes that try to do
anything with the window borders; I don't know why.

Try creating ~/.config/gtk-3.0/gtk.css containing:

decoration {
    border: 3px solid pink;
    background: pink;

Customize the width, color and style to taste.   Or, if you want finer
granularity, try this:

decoration {
    border-left: 3px solid pink;
    border-right: 3px solid purple;
    border-bottom: 6px solid green;
    background: pink;

(The actual colour you use for "background" doesn't appear to matter--I
think it just needs to be set to override the default of the border
being transparent.)

To put the change into effect, restart the gnome-shell window manager
(the easiest way is to hit Alt-F2, and type the command "r" to restart).

This changes the decoration for all windows; I don't know whether
there's a way to change the decoration for only some windows (e.g., only
pterm windows).

Hope this helps,

Dan Astoorian, Systems Administrator
Engineering Computing Facility
University of Toronto

More information about the u-u mailing list