在 Ubuntu 中使用和自定义程序坞
程序坞 停靠区 停靠栏
![](/data/attachment/album/202211/23/143533heym0bybbfm0bfbj.jpg)


当你登录 Ubuntu 时，你会看到屏幕左侧的 <ruby> 程序坞/停靠栏 <rt>  dock </rt></ruby>，上面有一些应用程序的图标。程序坞（也称为 <ruby> 启动器 <rt>  launcher </rt></ruby>，或者 <ruby> 面板 <rt>  panel </rt></ruby>）可以让你快速启动某个常用的应用程序。


![](/data/attachment/album/202211/23/143536w58oz8a99lrqaxep.png)


我经常使用程序坞。在本文中，我将分享一些关于有效使用程序坞的小技巧，并介绍自定义程序坞的外观和位置的方法。


你将在本教程中学习到以下内容：


* 程序坞的基本用途：添加应用程序，并使用快捷方式来启动应用程序
* 自定义程序坞的外观：更改图标大小、图标位置
* 更改程序坞的位置：可用于单屏和多显示器的设置
* 在程序坞中隐藏已安装的磁盘图标
* 自动隐藏或禁用程序坞
* 使用 `dconf-editor` 对程序坞进行额外的定制
* 用其他程序坞应用程序替换 Ubuntu 默认的程序坞


我将在教程中使用 <ruby> 程序坞 <rt>  dock </rt></ruby>、<ruby> 面板 <rt>  panel </rt></ruby>和 <ruby> 启动器 <rt>  launcher </rt></ruby> 等术语，它们的意思是等同的。


### 如何使用 Ubuntu 程序坞：你必须知道的基础知识


如果你是 Ubuntu 的新手，你需要掌握如何使用程序坞。尽管，在一段时间后你总会熟悉程序坞的功能，但是阅读本文能让你更快地明白。


#### 向程序坞添加新的应用程序（或删除应用程序）


这一步骤十分简单。从菜单中搜索你想要添加在程序坞的应用程序，然后运行它。


正在运行的应用程序会显示在程序坞中，它的图标在程序坞中所有图标的下方。右键单击该图标，然后选择 “<ruby> 添加到收藏夹 <rt>  Add to Favorites </rt></ruby>” 选项。这会把该应用程序的图标锁定到程序坞上。


![Right-click on the icon and select “Add to Favorites”](/data/attachment/album/202211/23/143537t0w9vwk9t2ewvp39.png)


从程序坞中删除应用程序的图标，操作起来更为简单。你不需要运行你想要在程序坞删除的应用程序，只需右键单击应用程序图标，然后选择 “<ruby> 从收藏夹中删除 <rt>  Remove From Favorites </rt></ruby>” 即可。


![Right-click on the icon and select “Remove from Favorites”](/data/attachment/album/202211/23/143537s7sr3rfft30sjqq3.png)


#### 更改程序坞中的图标顺序


默认情况下，新添加到程序坞的应用程序图标会放置在程序坞上的所有图标之后。但是，你也可以改变图标的位置。


要更改图标的顺序，你只需将它拖放到另一个位置即可，不用 “<ruby> 锁定位置 <rt>  lock it </rt></ruby>”，或者做其他的事情。如果你不做任何的更改，这个图标会一直停留在那个位置。


![Reorder Icons On Ubuntu Docks](/data/attachment/album/202211/23/143539u9oo247zij13o933.gif)


#### 右键单击程序坞中的图标，以获取应用程序的额外选项


左键单击程序坞中的图标会启动应用程序，或者如果应用程序已经在运行，则这个应用程序会被聚焦，即它会出现在所有其他正在运行的应用程序窗口前面。


右键单击程序坞中的图标会为你提供应用程序的额外选项。不同的应用程序会有不同的选项。


右键单击**浏览器**图标，在它的额外选项中，你可以打开一个新的私人窗口，或预览所有正在运行的窗口。


![](/data/attachment/album/202211/23/143540oa1uznt40cb0swzo.png)


右键单击**文件管理器**图标，在它的额外选项中，你可以查看所有已添加书签的目录，或预览打开的窗口。


当然，你也可以通过右键单击图标，来退出应用程序。大多数应用程序能够通过右键单击而退出，而一些应用程序（例如 Telegram 等），将被最小化到 <ruby> 系统托盘 <rt>  system tray </rt></ruby> 中。


#### 使用键盘快捷键，以快速启动程序坞中的应用程序 [知道这个的人不多]


你只需用鼠标单击程序坞上的图标，即可启动应用程序。但是，你也可以用键盘快捷键，来启动应用程序。


使用 `WIN`/`Super` + `数字键` 的组合，能够启动程序坞中该位置的应用程序。


![](/data/attachment/album/202211/23/143541lkg0hejee19ae0d1.png)


如果应用程序已经在运行了，它将被聚焦。


由于这个功能是基于位置的，所以请不要一直对图标进行重新排序。就我个人而言，我把 Firefox 放在程序坞的第 1 个位置，文件管理器放在第 2 个位置，备用浏览器放在第 3 个位置，以此类推，直到第 9 个位置。这样，我可以使用 `Super + 2`，从而快速启动文件管理器。


因为我的系统连接了 3 个屏幕，所以我发现这个快速启动应用程序的功能特别好用，我不必再将鼠标移动到第一个屏幕上的程序坞上了。你也可以在其他屏幕上启用或禁用程序坞，我将在本教程的后面部分向你展示如何设置。


### 改变程序坞在屏幕上的位置


默认情况下，程序坞位于屏幕的左侧。但是，有些人喜欢将程序坞放置在屏幕底部。


Ubuntu 允许你更改程序坞的位置。你可以将程序坞移至底部或右侧。我不觉得有很多人真的想要把扩展坞放在了顶部，所以没有将扩展坞移到顶部的选项。


![Change Launcher Position](/data/attachment/album/202211/23/143542b84zbjhd6pcdickw.png)


要更改程序坞位置，请进入 “<ruby> 设置 <rt>  Settings </rt></ruby>” 菜单，然后点击 “<ruby> 外观 <rt>  Appearance </rt></ruby>” ，你可以在 Dock 栏下看到一些选项，然后你可以在此处更改 “<ruby> 屏幕上的位置 <rt>  Position on screen </rt></ruby>” 这一设置。


![Go to Settings->Appearance->Dock](/data/attachment/album/202211/23/143542nqjtpxw4je8yctjv.png)


#### 程序坞在多显示器设置中的位置


如果你的系统连接了多个屏幕，你可以选择是在所有的屏幕上还是在某个选定的屏幕上，显示扩展坞。


![Ubuntu Dock Settings Multimonitor](/data/attachment/album/202211/23/143543dchwimo6kz9jlmwo.png)


对于我个人而言，我只在我的笔记本电脑屏幕上显示程序坞，因为这是我的主屏幕。这样在我的另外两个屏幕会留有最大的空间。


### 更改程序坞的外观


让我们继续看看 Ubuntu 程序坞中的更多自定义选项吧。


想象一下，如果你在程序坞中添加了太多的应用程序或打开了太多应用程序，那么程序坞的空间会被填满。如果你想要进入到程序坞端点处的应用程序，那么你必须滚动到程序坞顶部和底部才可以。


你可以更改程序坞的图标大小，来解决这个问题，这样程序坞就能够容纳更多图标来。不过，也不要让图标太小。


![](/data/attachment/album/202211/23/143544cq9dnsqrym0nq9rm.jpg)


要更改程序坞的图标大小，请进入 “<ruby> 设置 <rt>  Settings </rt></ruby>” 菜单，然后点击 “<ruby> 外观 <rt>  Appearance </rt></ruby>” ，并通过移动 “<ruby> 图标大小 <rt>  Icon size </rt></ruby>” 下的滑块来更改它。默认的图标大小为 48 像素。


![Changing Icon Size In Ubuntu Dock](/data/attachment/album/202211/23/143545lgvnenyntj9zuztn.png)


#### 在程序坞中隐藏已安装的磁盘图标


当你插入 U 盘或 SD 卡时，它的驱动器会安装到系统中，并且在程序坞中会立即出现一个图标。这个图标很有用，因为你可以直接通过右键单击它，来安全地删除驱动器选项。


![Mounted disks are displayed In the Ubuntu Dock](/data/attachment/album/202211/23/143546ddadbhthvao0ofio.png)


如果你认为在程序坞中显示已安装的磁盘图标很麻烦的话，你也可以关闭这个功能。别担心，你仍然可以从文件管理器访问已安装的驱动器。


打开终端，使用以下命令，来隐藏程序坞中已安装的磁盘图标：



```
gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false

```

更改会立即生效。你不再会为程序坞中显示已安装的磁盘而烦恼了。


如果你想要恢复默认情况，请使用以下命令：



```
gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts true

```

### 改变程序坞的行为


接下来，让我们自定义程序坞的默认行为，使它能更适合你的需求吧。


#### 启用点击最小化


如果你单击一个正在运行的应用程序的图标，那么这个应用程序的窗口将成为焦点。当如果你**再次单击**这个图标时，将什么都不会发生。这是因为，在默认情况下，第二次点击同一图标不会最小化应用程序。


这是现代桌面的默认行为，但我不太喜欢，我更喜欢的是：当我**第二次点击图标时，应用程序会被最小化**。


如果你像我一样，那么你可能想要在 Ubuntu 中 [启用点击最小化选项](https://itsfoss.com/click-to-minimize-ubuntu/)：


为此，请打开终端并输入以下命令：



```
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

```

#### 自动隐藏 Ubuntu 程序坞，以获得更多屏幕空间


如果你想要有最大的屏幕空间，你可以在 Ubuntu 中为程序坞启用自动隐藏选项。


自动隐藏选项会隐藏程序坞，你就能获得整个屏幕。不过，程序坞仍然可以使用。将光标移动到程序坞原来所在的位置，它就会再次出现。当程序坞重新出现时，它会覆盖在正在运行的应用程序窗口上。这是一件好事，否则太多元素会开始在屏幕上移动。


要设置程序坞自动隐藏，请进入 “<ruby> 设置 <rt>  Settings </rt></ruby>” 菜单，然后点击 “<ruby> 外观 <rt>  Appearance </rt></ruby>” ，你可以在 Dock 栏下开启 <ruby> 自动隐藏选项 <rt>  Auto-hide the Dock </rt></ruby>” 。


![Auto-hide the dock](/data/attachment/album/202211/23/143547t632k3eg5uk5g82k.png)


如果你不喜欢自动隐藏程序坞的话，你可以用同样的方式禁用它。


#### 禁用 Ubuntu 默认的程序坞


Ubuntu 程序坞的自动隐藏选项对很多人来说已经足够好了，但是依旧有些用户根本不喜欢 Ubuntu 自带的程序坞。如果你也是其中的一员，你可以选择完全禁用 Ubuntu 的程序坞。


从 Ubuntu 20.04 开始，你可以使用 <ruby> 扩展应用程序 <rt>  Extensions application </rt></ruby>，来管理 [GNOME 扩展](https://itsfoss.com/gnome-shell-extensions/)。


![Look for Extensions app in the menu](/data/attachment/album/202211/23/143547fafiomz9ah7n1noo.jpg)


使用这个扩展应用程序，你就可以轻松地禁用或重新启用程序坞了。


![Disable Ubuntu Dock](/data/attachment/album/202211/23/143548d4kyp4zq2h2i24cl.png)


### 使用 dconf-editor 进行高级的程序坞定制 [不推荐]


##### 请注意


`dconf-editor` 能让你更改 GNOME 桌面环境的几乎每个方面。这个性质喜忧参半，因为你在更改时必须小心，而且大多数设置都可以即时更改，无需确认。虽然你可以重置你的更改，但你仍可能会将系统置于难以恢复正常的状态。


出于这个原因，我不推荐你使用 `dconf-editor`，特别是如果你不喜欢花时间在故障排除和修复问题上，或者如果你不太熟悉 Linux 和 GNOME。


[dconf-editor](https://wiki.gnome.org/Apps/DconfEditor) 给你提供了在 Ubuntu 中自定义程序坞的其他选项。你可以在从软件中心安装 `dconf-editor`，然后导航到 `org > gnome > shell > extensions > dash-to-dock`，在这里你会找到很多自定义程序坞的选择。


![](/data/attachment/album/202211/23/143549a1uzeygzaq1q1wo4.png)


### 替换 Ubuntu 默认的程序坞


有几个第三方的程序坞应用程序可用于 Ubuntu 和其他 Linux 发行版。你可以安装你想要的第三方程序坞，并使用它。


例如，你可以从软件中心下载 “Plank dock”，并以与 Ubuntu 程序坞类似的方式来使用它。


![Plank Dock in Ubuntu](/data/attachment/album/202211/23/143549ra8qajeeytc5eaii.jpg)


在这种情况下，禁用 Ubuntu 默认的程序坞会是一个更好的主意，因为同时使用多个扩展坞是不太明智的。


### 总结


本教程介绍了在 GNOME 实现中，如何自定义 Ubuntu 默认的程序坞。上述程序坞的更改在 vanilla GNOME 的程序坞上运行良好。


我已经向你展示了大多数常见的 Ubuntu 程序坞的定制方法。你不需要去盲目地跟随教程中的所有步骤。阅读并思考哪一个是你需要的，然后根据教程中的方法更改配置。


如果你不喜欢 Ubuntu 默认的程序坞，也有其他的程序坞可供试验。


这个教程让你学到了新东西吗？你还想看到更多这样的教程吗？欢迎你在评论区中建议和反馈。




---


via: <https://itsfoss.com/customize-ubuntu-dock/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[chai001125](https://github.com/chai001125) 校对：[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)

When you log into Ubuntu, you’ll see the dock on the left side with some application icons on it. This dock (also known as launcher or sometimes as panel) allows you to quickly launch your frequently used programs.

![Ubuntu Dock](https://itsfoss.com/content/images/wordpress/2021/01/ubuntu-dock.png)

I rely heavily on the dock and I am going to share a few tips about using the dock effectively and customize its looks and position.

You’ll learn the following in this tutorial:

- Basic usage of the dock: adding more applications and using shortcuts for launching applications.
- Customize the looks of the dock: Change the icon size, icon positions.
- Change the position: for single screen and multi-monitor setup
- Hide mounted disk from the dock
- Auto-hide or disable the dock
- Possibility of additional dock customization with dconf-editor
- Replace dock with other docking applications

I’ll use the terms dock, panel and launcher in the tutorial. All of them refer to the same thing.

## Using the Ubuntu dock: Absolute basic that you must know

If you are new to Ubuntu, you should know a few things about using the dock. You’ll eventually discover these dock features, I’ll just speed up the discovery process for you.

### Add new applications to the dock (or remove them)

The steps are simple. Search for the application from the menu and run it.

The running application appears in the dock, below all other icons. Right click on it and select the “Add to Favorites” option. This will lock the icon to the dock.

![Right click on the icon and select "Add to Favorites" to add icons to the dock in Ubuntu](https://itsfoss.com/content/images/wordpress/2021/01/add-icons-to-dock.png)

Removing an app icon from the doc is even easier. You don’t even need to run the application. Simply right click on it and select “Remove From Favorites”.

![Right-click on the icon and select "Remove from Favorites" to remove icons from the dock in Ubuntu](https://itsfoss.com/content/images/wordpress/2021/01/remove-icons-from-dock.png)

### Reorder icon position

By default, new application icons are added after all the other icons on the launcher. You don’t have to live with it as it is.

To change the order of the icons, you just need to drag and drop to the other position of your choice. No need to “lock it” or any additional effort. It stays on that location until you make some changes again.

![Reorder Icons On Ubuntu Docks](https://itsfoss.com/content/images/wordpress/2021/01/reorder-icons-on-ubuntu-docks.gif)

### Right click to get additional options for some apps

Left-clicking on an icon launches the application or bring it to focus if the application is already running.

Right-clicking the icon gives you additional options. Different applications will have different options.

For browsers, you can open a new private window or preview all the running windows.

![Right Click Icons Ubuntu Dock](https://itsfoss.com/content/images/wordpress/2021/01/right-click-icons-ubuntu-dock.png)

For file manager, you can go to all the bookmarked directories or preview opened windows.

You can, of course, quit the application. Most applications will quit while some applications like Telegram will be minimized to the system tray.

### Use keyboard shortcut to launch applications quickly [Not many people know about this one]

The dock allows you to launch an application in a single mouse click. But if you are like me, you can save that mouse click with a keyboard shortcut.

Using the Super/Window key and a number key will launch the application on that position.

![Keyboard Shortcut For Ubuntu Dock](https://itsfoss.com/content/images/wordpress/2021/01/keyboard-shortcut-for-ubuntu-dock.png)

If the application is already running, it is brought to focus, i.e. it appears in front of all the other running application windows.

Since it is position-based, you should make sure that you don’t reorder the icons all the time. Personally, I keep Firefox at position 1, file manager at 2 and the alternate browser at 3 and so on until number 9. This way, I quickly launch the file manager with Super+2.

I find it easier specially because I have a three screen setup and moving the mouse to the launcher on the first screen is a bit too much of trouble. You can enable or disable the dock on additional screen. I’ll show that to you later in this tutorial.

## Change the position of the dock

By default, the dock is located on the left side of your screen. Some people like the launcher at the bottom, in a more traditional way.

[Ubuntu allows you to change the position of the dock](https://itsfoss.com/move-unity-launcher-bottom/). You can move it to the bottom or to the right side. I am not sure many people actually put the dock on the top, so moving the dock to the top is not an option here.

![Change Launcher Position in Ubuntu](https://itsfoss.com/content/images/wordpress/2021/01/change-launcher-position-ubuntu.png)

To change the dock position, go to Settings->Appearance. You should see some options under Dock section. You need to change the “Position on screen” settings here.

![Change Dock Position in Ubuntu](https://itsfoss.com/content/images/wordpress/2021/01/change-dock-position-ubuntu.png)

### Position of dock on a multiple monitor setup

If you have multiple screens attached to your system, you can choose whether to display the dock on all screens or one of the chosen screens.

![Ubuntu Dock Settings Multimonitor](https://itsfoss.com/content/images/wordpress/2021/01/ubuntu-dock-settings-multimonitor.png)

Personally, I display the dock on my laptop screen only which is my main screen. This gives me maximum space on the additional two screens.

## Change the appearance of the dock

Let’s see some more dock customization options in Ubuntu.

Imagine you added too many applications to the dock or have too many applications open. It will fill up the space and you’ll have to scroll to the top and bottom to go to the applications at end points.

What you can do here is to change the icon size and the dock will now accommodate more icons. Don’t make it too small, though.

To do that, go to Settings-> Appearance and change it by moving the slider under Icon size. The default icons size is 48 pixels.

![Changing Icon Size In Ubuntu Dock](https://itsfoss.com/content/images/wordpress/2021/01/changing-icon-size-in-ubuntu-dock.png)

### Hide mounted disks from the launcher

If you plug in a USB disk or SD Card, it is mounted to the system, and an icon appear in the launcher immediately. This is helpful because you can right click on it and select safely remove drive option.

![External Mounted Disks In Ubuntu Dock](https://itsfoss.com/content/images/wordpress/2021/01/external-mounted-disks-in-ubuntu-dock.png)

If you somehow find it troublesome, you can turn this feature off. Don’t worry, you can still access the mounted drives from the file manager.

Open a terminal and use the following command:

`gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts false`


The changes take into effect immediately. You won’t be bothered with mounted disk being displayed in the launcher.

If you want the default behavior back, use this command:

`gsettings set org.gnome.shell.extensions.dash-to-dock show-mounts true`


## Change the behavior of dock

Let’s customize the default behavior of the dock and make it more suitable to your needs.

### Enable minimize on click

If you click on the icon of a running application, its window will be brought to focus. That’s fine. However, if you click on it, nothing happens. By default, clicking on the same icon won’t minimize the application.

Well, this is the behavior in modern desktop, but I don’t like it. I prefer that the application is minimized when I click on its icon for the second time.

If you are like me, you may want to [enable click to minimize option in Ubuntu](https://itsfoss.com/click-to-minimize-ubuntu/):

To do that, open a terminal and enter the following command:

`gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'`


### Auto-hide Ubuntu dock and get more screen space

If you want to utilize the maximum screen space, you can enable auto-hide option for the dock in Ubuntu.

This will hide the dock, and you’ll get the entire screen. The dock is still accessible, though. Move your cursor to the location of the dock where it used to be, and it will appear again. When the dock reappears, it is overlaid on the running application window. And that’s a good thing otherwise too many elements would start moving on the screen.

The auto-hide option is available in Settings-> Appearance and under Dock section. Just toggle it.

![Autohide the Dock Ubuntu](https://itsfoss.com/content/images/wordpress/2021/01/autohide-dock-ubuntu.png)

If you don’t like this behavior, you can enable it again the same way.

### Disable Ubuntu dock

Auto-hide option is good enough for many people, but some users simply don’t like the dock. If you are one of those users, you also have the option to disable the Ubuntu dock entirely.

Starting with Ubuntu 20.04, you have the Extensions application available at your disposal to [manage GNOME Extensions](https://itsfoss.com/gnome-shell-extensions/).

![Gnome Extensions App Ubuntu](https://itsfoss.com/content/images/wordpress/2020/06/GNOME-extensions-app-ubuntu.jpg)

With this Extensions application, you can easily disable or re-enable the dock.

![Disable Dock Ubuntu](https://itsfoss.com/content/images/wordpress/2021/01/disable-dock-ubuntu.png)

## Advanced dock customization with dconf-editor [Not recommended]

The [dconf editor](https://wiki.gnome.org/Apps/DconfEditor) gives you additional options to customize the dock in Ubuntu. Install it from the software center and then navigate to org > gnome > shell > extensions > dash-to-dock. You’ll find plenty of options here. I cannot even list them all here.

![Dconf Editor Dock](https://itsfoss.com/content/images/wordpress/2021/01/dconf-editor-dock.png)

## Replace the dock in Ubuntu

There are several third-party dock applications available for Ubuntu and other Linux distributions. You can install a dock of your choice and use it.

For example, you can install Plank dock from the software center and use it in similar fashion to Ubuntu dock.

![Plank Dock Ubuntu](https://itsfoss.com/content/images/wordpress/2021/01/plank-dock-Ubuntu.jpg)

Disabling Ubuntu Dock would be a better idea in this case. It won’t be wise to use multiple docks at the same time.

## Conclusion

This tutorial is about customizing the default dock or launcher provided in Ubuntu’s GNOME implementation. Some suggestions should work on the dock in vanilla GNOME as work well.

I have shown you most of the common Ubuntu dock customization. You don’t need to go and blindly follow all of them. Read and think about which one suits your need, and then act upon it.

If you don’t like the default one, there are always [other docking options](https://itsfoss.com/best-linux-docks/) available to experiment with.

[7 Docks to Customize Your Linux DesktopA dock has been an important part of the Linux desktop experience for decades. It provides a handy way of quickly accessing your favorite, frequently used applications. Unfortunately, the popular desktop environment GNOME doesn’t provide a dock. Fret not. You can always install a Docking applicati…](https://itsfoss.com/best-linux-docks/)![](https://itsfoss.com/content/images/wordpress/2022/07/best-linux-docks.jpg)


![](https://itsfoss.com/content/images/wordpress/2022/07/best-linux-docks.jpg)

And don't limit yourself to customizing just the dock. There are many more ways you can customize Ubuntu. If you want, you may give them a try as well.

[Customize Ubuntu 18.04 GNOME With These Simple TipsBrief: Some basic and some interesting GNOME customization tips to get more out of your Ubuntu 18.04 desktop. When I last wrote about things to do after installing Ubuntu 18.04, I didn’t focus a lot on customizing GNOME. It’s because tweaking GNOME is a vast topic](https://itsfoss.com/gnome-tricks-ubuntu/)![](https://itsfoss.com/content/images/wordpress/2017/12/gnome-cutomization-featured.png)


![](https://itsfoss.com/content/images/wordpress/2017/12/gnome-cutomization-featured.png)

Was it too trivial or did you learn something new? Would you like to see more such tutorials? I welcome your suggestions and feedback on dock customization.