32

I'm running GNOME 3.18 and I would like to reduce the title bar height.

How could I do it?

32

After Gnome 3.20, .header-bar.default-decoration doesn't work.

You can put follow content into ~/.config/gtk-3.0/gtk.css:

/* shrink headerbars (don't forget semicolons after each property) */
headerbar {
    min-height: 0px;
    padding-left: 2px; /* same as childrens vertical margins for nicer proportions */
    padding-right: 2px;
    background-color: #2d2d2d;
}

headerbar entry,
headerbar spinbutton,
headerbar button,
headerbar separator {
    margin-top: 0px; /* same as headerbar side padding for nicer proportions */
    margin-bottom: 0px;
}

/* shrink ssd titlebars */
.default-decoration {
    min-height: 0; /* let the entry and button drive the titlebar size */
    padding: 0px;
    background-color: #2d2d2d;
}

.default-decoration .titlebutton {
    min-height: 0px; /* tweak these two props to reduce button size */
    min-width: 0px;
}

window.ssd headerbar.titlebar {
    padding-top: 3px;
    padding-bottom: 3px;
    min-height: 0;
}

window.ssd headerbar.titlebar button.titlebutton {
    padding-top: 3px;
    padding-bottom:3px;
    min-height: 0;
}

via https://ogbe.net/blog/gnome_titles.html

4
  • For me, this caused the far-right window buttons to squish together. To fix this, I had to replace lines 13 and 14 (margin-top, margin-bottom) with simply margin: 0px; (which implies all four margin-* directions).
    – brandones
    Apr 4 '19 at 1:20
  • 2
    I also had to add padding-right: 6px; as line 31 in order to put some padding between the side of the window headerbar and the "close window" X button.
    – brandones
    Apr 4 '19 at 1:22
  • 1
    and similar after @brandones line I add padding-left: 6px, to not have the icon from some applications being squished to the edge. Oct 25 '19 at 21:39
  • 1
    Here's Robert Lu's CSS with the modifications suggested by brandones & Christian: github.com/JackKelly/linux_home/blob/master/.config/gtk-3.0/…
    – Jack Kelly
    Oct 16 '20 at 9:42
12

To reduce the titlebar size just create a css file in this location: ~/.config/gtk-3.0/gtk.css and copy paste the code below; this will resize the titlebar:

.header-bar.default-decoration {
        padding-top: 0px;
        padding-bottom: 0px;
    }

.header-bar.default-decoration .button.titlebutton {
    padding-top: 0px;
    padding-bottom: 0px;
}

you can add this code (on the same file) to remove the line under the titlebar to reduce a little bit more the size:

/* No line below the title bar */
.ssd .titlebar {
    border-width: 0;
    box-shadow: none;
}

press ALT + F2, type r in the box that appears and hit Enter to reload the gnome shell.

And you're good to go :)

0
5

For maximized windows, I can recommend this Gnome Shell Extension called Pixel Saver by a guy deadalnix. The title bar will disappear (more space for notebook users), but you can still see the window title in the black activity bar.

enter image description here

1

Depending on your Linux distribution and the package manager and/or package, install Gnome Tweak Tool.

Gnome Tweak Tool

Select the "Fonts" tab in the side-menu.

Then, set the Text Height for Window Titles to as low a number as you like.

Window Titles Font Selection

NOTE: this is only applicable for older versions of GNOME

2
  • Doesn't change the titlebar size, just the font size in the titlebar so no good.
    – Dave Moten
    Jul 31 '19 at 3:22
  • This applies to older versions of GNOME only. It is irrelevant for versions after 3.20, as @RobertLu mentioned in that answer.
    – ILMostro_7
    Aug 6 '19 at 0:09
1
.titlebar, headerbar {
    min-height: 0px;
    padding: 0px;
    margin: 0px;
}
headerbar entry,
headerbar spinbutton,
headerbar button,
headerbar separator {
    min-height: 0px;
    padding: 0px;
    margin: 1px;
}
/*
more or less normal
write this in ~\.config\gtk-3.0\gtk.css
use slashes instead of backslashes
slashes just terrifyin my nano (:
*/

my desktop Works for Ubuntu 18.04 with gnome-session-flashback

0
0

None of the solutions seem to modify the Adwaita so I found Minwaita solution.
Minwaita git here

Git repo did not include install info. Instructions to install are move the unzipped

  • Minwaita.tar.gz
  • Minwaita-OSX.tar.gz
  • Minwaita-Vanilla.tar.gz

folder to
/usr/share/themes/
directory where you will find original Gnome Adwaita folder. Install the gnome tweak tool to switch themes.
└─$ sudo apt install gnome-tweak-tool
Applications sub menu of tweak tool will show the option for themes.

Others solutions: https://www.gnome-look.org/p/1174686/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.