Decrease the tabs bar height in gnome terminal

社会主义新天地 提交于 2020-06-25 07:53:46

问题


I recently installed Lubuntu 16.04 with gnome-terminal. I like gnome-terminal to consume less space on monitor. But latest version comes with two annoying buttons at the right top corner which makes no sense to me. Because, user who prefer terminals are more likely to use keyboard shortcuts to do tabs operations rather than go for mouse clicks. With these two extra buttons tabs bar got wider and uses more space on the monitor. Click here for Screenshot . Please help me in removing this extra two buttons from the gnome-terminal window.

Thanks in Advance

Madhusudhan


回答1:


As I am running gnome shell 3.22.2 (same as izy) which ships with gnome-terminal 3.22.1 (under Arch), the solution posted by Lari Hotari doesn't work for me. It turns out that the CSS class name has changed in bug report #765590. The name is now terminal-window instead of TerminalWindow. This has been shipping with gnome since 3.20.2-ish.

The following snippet for ~/.config/gtk-3.0/gtk.css reduces the vertical size of gnome-terminal by 10px for me. Note that I tried hiding the two buttons by setting display: none but this has no effect. Maybe gtk-3.0 does not allow hiding ui elements (no idea).

/* Decrease the tabs bar height in gnome-terminal
 * See:
 * https://stackoverflow.com/questions/36869701/decrease-the-tabs-bar-height-in-gnome-terminal
 */

terminal-window notebook > header.top button {
  padding: 0 0 0 0;
  background-image: none;
  border: 0;
  margin-right: 10px;
}
terminal-window notebook > header.top > tabs > tab {
  margin: 0 0 0 0;
  padding: 0 0 0 0;
}
terminal-window notebook > header.top > tabs > tab label {
  padding: 0 0 0 0;
  margin: 0 0 0 0;
}

Make sure to logout/login out of gnome-session after changing the css file.

Before:

After:

Update: actually removing the two buttons from the tabs menu bar in the top right corner (as requested by the OP) requires you to re-compile gnome-terminal (it isn't that difficult with apt source under ubuntu). Just remove the terminal_window_fill_notebook_action_box call on line 2792 in src/terminal-window.c: https://github.com/GNOME/gnome-terminal/blob/8975986d51639040ceb6ba1c0dc78f6a3fa9da45/src/terminal-window.c#L2792




回答2:


Adding this to ~/.config/gtk-3.0/gtk.css works for me. It doesn't remove the buttons, but makes them nicer for a dark theme and use less vertical space.

TerminalWindow .notebook .button,
TerminalWindow .notebook .button:active {
    padding: 2 2 2 10;
    background-image: none;
    border: 0;
}

I'm using this customization, works well with a dark theme:

@define-color bg-grey #222;
@define-color active-grey #333;
@define-color border-grey #555;

TerminalWindow .notebook {
  border: 0;
  padding: 0;
  color: #eee;
  background-color: shade(@active-grey, 1);
}

TerminalWindow .notebook tab:active {
  border: 1px solid @border-grey;
  background-color: shade(@active-grey, 1);
}

TerminalWindow .notebook tab {
  background-color: shade(@bg-grey, 1);
}

TerminalWindow .notebook .button,
TerminalWindow .notebook .button:active {
    padding: 2 2 2 10;
    background-image: none;
    border: 0;
}



回答3:


xfce4 xubuntu 17.10

tee --append ~/.config/gtk-3.0/gtk.css <<SMALLERTABS

notebook tab {
  min-height: 0;
  padding-top: 0px;
  padding-bottom: 0px;
}

notebook tab button {
  min-height: 0;
  min-width: 0;
  padding: 0px;
  margin-top: 0px;
  margin-bottom: 0px;
}

notebook button {
  min-height: 0;
  min-width: 0;
  padding: 0px;
}
SMALLERTABS

close terminal and reopen

reference:

  • https://forum.xfce.org/viewtopic.php?id=11224



回答4:


Gnome 3.28.3 on Ubuntu 18.04

The following code removes the button for me. Here is the effect

notebook.terminal-notebook > header > box button,
notebook.terminal-notebook > header > box button:hover,
notebook.terminal-notebook > header > box button:hover:backdrop {
    margin-top: -100px;        /*this is the line that makes buttons disappear.*/
    background: inherit;
    border: inherit;
    padding: inherit;
}




回答5:


you can remove them easy in dconf editor.. /io/elementary/terminal/settings/

tab-bar-behavior..... select "hide when single tab" or never show tabs...



来源:https://stackoverflow.com/questions/36869701/decrease-the-tabs-bar-height-in-gnome-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!