在 GNOME 中添加最小化和最大化按钮
GNOME
![](/data/attachment/album/202310/18/104631i5gbbz3mwkfp5gmu.jpg)



> 
> 缺少了 GNOME 中的最小化按钮选项？下面教你如何轻松找回它。
> 
> 
> 


与 Ubuntu 不同，[Fedora](https://itsfoss.com/best-fedora-linux-distributions/) 和 Arch Linux 等发行版为你提供了原生的 GNOME，但可能让你烦恼的一件事是应用窗口上缺少最小化和最大化按钮。


![No minimize or maximize button in application windows, only close button](/data/attachment/album/202310/18/104703fgjycvtrrgrij5df.png)


GNOME 希望你使用应用切换器（`Alt+Tab`）或使用活动区（`Super` 键）在正在运行的应用之间切换，而不是最小化它。


好消息是，如果你不喜欢的话，你不必这样。


让我分享一下如何使用 GUI 和命令行选项恢复 GNOME 中的最小化和最大化按钮。


### 方法 1：使用 GNOME 优化工具启用最小化和最大化按钮


GNOME <ruby> 优化 <rt>  Tweaks </rt></ruby> 工具允许你自定义 GNOME 的各个方面。启用最小化窗口按钮就是其中之一。


首先使用发行版的包管理器安装 GNOME 优化工具。


运行应用并从左侧边栏进入 Windows 标题栏。你将在此处看到添加最小化和最大化按钮的选项，


![](/data/attachment/album/202310/18/104704apo9tjwckxyjkjgk.png)


你可以选择其中一个或两者。如果你不再需要它，**你可以在 GNOME 调整工具中以相同的方式禁用按钮**。



> 
> ? 如果需要，你还可以选择将这些控制按钮放在左侧。该选项位于标题栏按钮选项的末尾。
> 
> 
> 


### 方法 2：使用命令行启用最小化和最大化按钮


`gsettings` 命令可以选择更改按钮布局并添加最小化和最大化按钮。



```
gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"

```

正如你所猜测的，如果你想要**禁用任何按钮，你可以运行相同的命令，但从命令中省略不需要的按钮**。



> 
> ? 你还可以通过将冒号放在命令的右侧来将 Windows 控制按钮移动到左侧：
> 
> 
> 
> ```
> gsettings set org.gnome.desktop.wm.preferences button-layout "close,minimize,maximize:"
> 
> ```
> 
> 


### 受到 macOS 的启发并不总是一件好事


显然，这种“无最小化按钮”的设计灵感来自苹果的 macOS。我记得大约 10 年前，macOS 曾经将窗口控件放在左侧。因此 Ubuntu Unity 也尝试默认将控件保留在左侧。


苹果很奇怪。他们大多数时候都有很好的设计，但有时他们会优先考虑设计而不是使用体验。“Magic Mouse” 就是一个例子。



> 
> “Magic Mouse 深受用户喜爱”。你确定？ 
> 
> 
> ![](/data/attachment/album/202310/18/105058q42ry0z4sprj76y5.jpg)
> 
> 
> — Stuart (@stuwieface) [2021 年 4 月 20 日](https://twitter.com/stuwieface/status/1384561367223521286?ref_src=twsrc%5Etfw)
> 
> 
> 


我不明白为什么 GNOME 开发者需要从各种设计中获得灵感，尤其是那些糟糕的设计。


但那只是我的个人意见。我很高兴有一个快速简单的解决方案可以恢复 GNOME 中的最小化和最大化按钮。


*（题图：MJ/f8ce0441-3d9b-498c-8e23-e48f7a90d040）*




---


via: <https://itsfoss.com/gnome-minimize-button/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

Unlike Ubuntu, [distributions like Fedora](https://itsfoss.com/best-fedora-linux-distributions/) and Arch Linux give you vanilla GNOME and one thing that may bother you is the lack of minimize and maximize buttons on the application windows.

![Missing minimize button in GNOME](https://itsfoss.com/content/images/2023/10/missing-minimize-button-gnome.png)

GNOME expects you to use the application switcher (Alt+Tab) or utilize the activities area (Super key) to just switch between running applications, instead of minimizing it.

The good thing is that you don't have to live like that if you don't want it.

Let me share how you can bring back the minimize and maximize buttons in GNOME using both GUI and command line options.

## Method 1: Enable minimize and maximize buttons using GNOME Tweaks

GNOME Tweaks tool allows you customize various aspects of GNOME. Enabling minimize windows buttons is one of them.

Install GNOME Tweaks tool using your distribution's package manager first.

Run the application and go to the Windows Titlebars from the left sidebar. You'll see the options to add minimize and maximize buttons here,

![Enable minimize and maximize buttons in GNOME applications](https://itsfoss.com/content/images/2023/10/enable-minimize-maximize-windows-option-gnome-tweaks.png)

You can choose either or both. If you don't want it anymore, **you can disable the buttons the same way in GNOME Tweaks tool**.

## Method 2: Use command line to enable minimize and maximize buttons

The gsettings command has the option to change the button layout and add the minimize and maximize buttons.

```
gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"
```


As you can guess, if you want **to disable any of the buttons, you run the same command but omit the undesired one from the command**.

gsettings set org.gnome.desktop.wm.preferences button-layout "close,minimize,maximize:"

## Getting inspired by macOS is not always a good thing

Clearly, this 'no minimize button' design is inspired by Apple's macOS. I remember that around 10 years back, macOS used to have the Windows control on the left. So Ubuntu Unity also tried keeping controls on the left side by default.

Apple is weird. They have good designs most of the time but they prioritize design over user experience at times. The 'magic mouse' is an example.

“Magic Mouse loved by users”. You sure about that?

— Stuart (@stuwieface)[pic.twitter.com/hxGtTxIrlu][April 20, 2021]

I don't see why GNOME developers have this need of getting inspired by every design, specially the poor ones.

But that's just my opinion. I am happy that there exists a quick and easy solution to bring back the minimize and maximize buttons in GNOME.