43

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

How could I do it?

R Philippe
  • 431
  • 1
  • 4
  • 4

6 Answers6

41

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

Robert Lu
  • 511
  • 4
  • 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 04 '19 at 01: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 04 '19 at 01: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. – Christian Herenz Oct 25 '19 at 21:39
  • 3
    Here's Robert Lu's CSS with the modifications suggested by brandones & Christian: https://github.com/JackKelly/linux_home/blob/master/.config/gtk-3.0/gtk.css – Jack Kelly Oct 16 '20 at 09:42
  • how do I apply this? – stiv Feb 15 '22 at 06:40
  • 1
    You have to log out and log back in – Nico Oct 28 '22 at 01:13
  • Reload Gnome without logout: Alt+F2, type letter r, enter – Regis Jan 05 '23 at 04:03
  • @Regis - thanks but that wasn't sufficient for me; logging out and back in did work. – Jeff Learman Mar 06 '23 at 14:57
14

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 :)

don_crissti
  • 79,330
  • 30
  • 216
  • 245
dreboy
  • 141
  • 3
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

aliopi
  • 163
  • 1
  • 7
3
.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

2

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

ILMostro_7
  • 3,199
  • 1
  • 21
  • 27
  • Doesn't change the titlebar size, just the font size in the titlebar so no good. – Dave Moten Jul 31 '19 at 03:22
  • This applies to older versions of GNOME only. It is irrelevant for versions after 3.20, as @RobertLu mentioned in [that answer](https://unix.stackexchange.com/a/343643/27776). – ILMostro_7 Aug 06 '19 at 00:09
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/

PaSe
  • 11
  • 1