Decrease titlebar height in GNOME 3.19+

2021年10月8日 · 274 字 · 1 分钟

为了用上 fcitx-5,把系统一口气升级到了 ubuntu 21.10 . 升级完发现,Terminal 的标题栏好宽,好难看,接受不了。

网上找了很多方案:

方案一: 修改GTK 配置

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;
}

个人体验不佳,而且影响所有窗口。

方案二: 用 dconf-editor 修改 Terminal header 属性

sudo apt install dconf-editor

Open DConf editor, then set org->gnome->terminal->legacy->headerbar to false. Restart the terminal. Done.

对比图


REF

1. How to reduce title bar height?
2. Header/Title Bar on GNOME Shell 3.32.2 too Thick/Big
3. How to join two images into one with FFmpeg?