6

I am using a fairly recent version of Cinnamon (5.4.12), with desktop theme Adwaita-dark (and Adwaita sometimes).

When I start a gnome-terminal window, it has a very thin (1px?) white border all around it. But as I like black terminals, I configured a black background to it, but now, I cannot see the window borders anymore. This also happens with other dark background applications.

It can be very confusing to know which is which when terminal windows are overlapping, or even just next to one another.

I tried to change this colour with no success:

  • by searching in the theme files in /usr/share/themes/Adwaita,
  • by playing with ~/.config/gtk-3.0/gtk.css to override some configuration,
  • by reading other similar questions, but they are either outdated or not applying to my use case.

So, how can I change the border colour of gnome-terminal (and possibly all other) windows to white?

4 Answers 4

6

What worked for me is adding this to the gtk.css file (which for me is located in ~/.config/gtk-3.0)

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

It makes the border of the windows grey (or any color you want) instead of black. It applies to all GTK 3 apps, not just the terminal, but it does solve the terminal problem!

The theme I'm running is Mint-Y Dark on Cinnamon 5.6.8

After modifying the file, reloading cinnamon will make the settings take effect: Alt-F2 | r | Enter

4
  • With GNOME Shell 3.38.2, gtk.css is not located in ~/.config/gtk-3.0, <br/>$ find . -name gtk.css <br/> ./snap/snap-store/959/.config/gtk-3.0/gtk.css Is this version the correct one to edit? Commented Jul 31, 2023 at 22:24
  • Awesome! It worked for me, thanks omnikin. Would you add a little bit of context on how you found this solution? So that next time, or for other tweakings, I know where to look for. Commented Jan 23, 2024 at 19:42
  • Perfect. And the tip for reloading Cinnamon was new to me as well. Thanks! Commented May 15 at 18:53
  • @Totor unfortunately, I don't remember where I found this idea! I did spend a lot of time looking through the theme css files so maybe I got the "decoration" from there Commented May 18 at 13:28
0

VTE, responsible for doing the actual terminal emulation and displaying the result in GNOME Terminal, does indeed have a 1px (by default) padding.

For example, if you choose a font where character cells are 10×20 pixels, and have a terminal of the default 80×24 size, the overall size used for actual terminal emulation purposes won't be 800×480 pixels but rather 802×482.

This behavior is not uncommon at all in terminals. Reasons for the padding include to allow room for an outlined rectangle cursor around the cell (the rectangle being drawn around the cell rather than within makes the letter underneath more readable), to allow room for a tiny overflow of antialiased letters (which is more common than probably one would think, e.g. at the right edge of m, w letters), to allow a fullscreen VTE to know if the mouse has been dragged out of the regular cells area, and also to IMO look visually more pleasing.

The width of the padding can easily be configured (enlarged – I faced some geometry (resizing) problems if I set it to 0).

The color of this padding, however, is always the same as VTE's current default background color, it's not controlled by any GTK property (other than, well, VTE possibly taking the default background color from GTK).

Then, depending of the GTK theme, if you have multiple tabs opened in gnome-terminal then the notebook widget might display a border (although I believe it's uncommon these days), and then there comes whatever border the window manager might display (where again the trend nowadays is not to display a border).

The purpose of VTE's padding, or the purpose of the notebook widget's border (if any) is not to help you see the edges between different windows. This IMO belongs to the window manager. You should see how to configure your window manager to draw a border around windows, or to cast some light on the neighboring windows, or something along these lines – after all, presumably you also want to tell apart your browser windows displaying black webpages, etc.

To summarize: Don't try to solve it in the terminal, try to solve in a generic way that applies to all apps. Traditionally that would mean configuring your desktop environment / window manager / compositor. With GTK's new client side decoration (CSD) world, this might actually easily be a GTK configuration. Unfortunately I can't help you with this, but I hope my partial response was useful.

2
  • Why do I have a thin black border on my terminal window when I set it on black text & white background then? Commented Nov 21, 2022 at 13:53
  • Probably it's drawn by the window manager, or GTK (as part of CSD), but not explicitly belongs to VTE or GNOME Terminal. A screenshot could perhaps help answering that question. Commented Nov 21, 2022 at 17:58
0

I'm using Gnome 48 on Ubuntu 25.04 with mostly-default settings. The application where the lack of borders most bothered me was my terminal window using green-on-black colors. The advice around here led me to create $HOME/.config/gtk-3.0/gtk.css to say

decoration { border:3px solid LightGrey; }

which affects the terminal, Firefox-installed-from-snap, and most other applications. (Haven't checked everything, but the only one I've noticed not doing that is the System Monitor. The rounded top bar corners on Firefox look a bit ugly. The light grey's because it's fairly unobtrusive on most of my light-mode Firefox windows.)

-3

To change the border colour of Gnome Terminal windows to white you can use the gsettings command to modify the theme setting in the org.gnome.desktop.wm.preferences schema.

Here is an example of how you can do this:

# Set the theme to "Adwaita:white"
gsettings set org.gnome.desktop.wm.preferences theme "Adwaita:white"

This command will set the theme to the "Adwaita:white" variant of the default Gnome theme, which has a white border colour. You can use any other theme that has a white border colour by specifying the theme name instead of "Adwaita:white".

Note that this change will only affect the current user. If you want to change the border color for all users, you can use the dconf command instead of gsettings. For example:

# Set the theme to "Adwaita:white" for all users
dconf write /org/gnome/desktop/wm/preferences/theme "'Adwaita:white'"

You may need to log out and log back in for the changes to take effect.

Alternatively, you can use the Gnome Tweaks tool (formerly known as Gnome Tweak Tool) to change the border color and other window manager settings. To install Gnome Tweaks, you can use your package manager or follow the instructions on the Gnome Tweaks website.

2
  • I don't want to use Adwaita:white, I want to use Adwaita:dark, with custom window border for my terminal window. I don't need help in switching to a different theme. I need help in customising the theme I'm already using, so that there is a thin white border around my terminal windows. Commented Dec 19, 2022 at 0:05
  • GNOME Tweaks 3.34.0 does not provide any setting for window border colors. Is there a different version that does? Commented Jul 31, 2023 at 22:28

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.