19

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

Any ideas ?

21

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

  • I believe a semicolon is missing on line 20 padding: 0px – Troy Folger Apr 4 '17 at 23:33
  • 2
    Awesome! Works in Bionic too. Just changed the 3px values to 1px and it's nice and minimal. – Justin Jun 2 '18 at 16:48
  • 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 at 1:20
  • 1
    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 at 1:22
  • 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 at 21:39
11

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

  • 4
    This seems to no longer work on gnome-application in Gnome 3.20, see my questions here. Any ideas of how to modify the css to apply to gnome-programs, such as Nautilus in 3.20? – joelostblom Apr 16 '16 at 21:34
  • 2
    doesn't work anymore – Luciano May 6 '16 at 13:37
3

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

0

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

  • Doesn't change the titlebar size, just the font size in the titlebar so no good. – Dave Moten Jul 31 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 at 0:09
0
.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

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.