2016-04-26 77 views
5

我最近用gnome-terminal安裝了Lubuntu 16.04。我喜歡gnome-terminal在顯示器上佔用更少的空間。但最新版本在右上角帶有兩個煩人的按鈕,這對我來說毫無意義。因爲喜歡終端的用戶更有可能使用鍵盤快捷鍵來執行製表符操作,而不是進行鼠標點擊。隨着這兩個額外的按鈕標籤欄變寬,並在顯示器上使用更多的空間。 Click here for Screenshot 。請幫我從gnome-terminal窗口中刪除這兩個額外的按鈕。減少gnome終端中的標籤欄高度

由於提前

Madhusudhan

回答

3

添加這~/.config/gtk-3.0/gtk.css爲我工作。它不會刪除按鈕,但使它們更適合黑暗主題並使用較少的垂直空間。

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

我使用這種定製,具有深色主題效果很好:

@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; 
} 
+1

不適用於Fedora 25,Gnome 3.22.2 – izy

+0

@izy:查看我的答案,下面爲我節省了10個寶貴的真實像素莊園:) – logion

6

正如我運行GNOME外殼3.22.2(同IZY)所附帶的gnome-terminal 3.22。 1(在Arch下),Lari Hotari發佈的解決方案對我來說不起作用。事實證明,在bug report #765590中,CSS類名稱已更改。該名稱現在是終端窗口而不是TerminalWindow。自從3.20.2-ish以來,這已經與gnome一起發佈。

~/.config/gtk-3.0/gtk.css的以下片段將我的gnome-terminal的垂直尺寸減小了10px。請注意,我試圖隱藏兩個按鈕通過設置顯示:無,但這沒有效果。也許gtk-3.0不允許隱藏UI元素(不知道)。

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

確保註銷/更改CSS文件後,登錄了GNOME的會話。

前: Screenshot before modification

後: Screenshot after modification

更新:其實去除右上角從標籤菜單欄中的兩個按鈕(由OP的要求),您需要重新編譯gnome-terminal(在Ubuntu下使用apt源碼並不困難)。只需刪除src/terminal-window.c中2792行的terminal_window_fill_notebook_action_box調用即可:https://github.com/GNOME/gnome-terminal/blob/8975986d51639040ceb6ba1c0dc78f6a3fa9da45/src/terminal-window.c#L2792