Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Decrease the tabs bar height in gnome terminal

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

like image 224
Madhusudhan Kasula Avatar asked Apr 26 '16 15:04

Madhusudhan Kasula


People also ask

How do I make my gnome title bar smaller?

Depending on your Linux distribution and the package manager and/or package, install 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.

How do I switch between tabs in gnome terminal?

3 Answers. You can switch the tabs using Ctrl + PgDn to next tabs and Ctrl + PgUp for the previous tabs. Reordering can be done using Ctrl + Shift + PgDn and Ctrl + Shift + PgUp .


2 Answers

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: Screenshot before modification

After: Screenshot after modification

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

like image 100
fvdnabee Avatar answered Sep 17 '22 15:09

fvdnabee


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;
}
like image 31
Lari Hotari Avatar answered Sep 18 '22 15:09

Lari Hotari