如何在 Ubuntu 桌面手动添加应用快捷方式
GNOME 桌面

> 
> 在这篇快速指南中，你将学到如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中添加应用图标。
> 
> 
> 


一个经典的桌面操作系统在“桌面屏”上总是有图标的。这些桌面图标包括文件管理器、回收站和应用图标。


当在 Windows 中安装应用时，一些程序会询问你是否在桌面创建一个快捷方式。但在 Linux 系统中不是这样。


但是如果你热衷于这个特点，让我给你展示如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中创建应用的快捷方式。


![Application Shortcuts on Desktop in Ubuntu with GNOME desktop](/data/attachment/album/201905/18/222559yjjrq3qdje8nmy2j.jpg)


如果你想知道我的桌面外观，我正在使用 Ant 主题和 Tela 图标集。你可以获取一些 [GTK 主题](https://itsfoss.com/best-gtk-themes/) 和 [为 Ubuntu 准备的图标集](https://itsfoss.com/best-icon-themes-ubuntu-16-04/)并换成你喜欢的。


### 在 Ubuntu 中添加桌面快捷方式


![](/data/attachment/album/201905/18/222603wm7tmyykhttehyyy.jpg)


个人来讲，我更喜欢为应用图标准备的 Ubuntu 启动器方式。如果我经常使用一个程序，我会添加到启动器。但是我知道不是每个人都有相同的偏好，可能少数人更喜欢桌面的快捷方式。


让我们看在桌面中创建应用快捷方式的最简单方式。



> 
> 免责声明
> 
> 
> 这篇指南已经在 Ubuntu 18.04 LTS 的 GNOME 桌面上测试过了。它可能在其他发行版和桌面环境上也能发挥作用，但你必须自己尝试。一些 GNOME 特定步骤可能会变，所以请在[其他桌面环境](https://itsfoss.com/best-linux-desktop-environments/)尝试时注意。
> 
> 
> 


#### 准备


首先最重要的事是确保你有 GNOME 桌面的图标权限。


如果你跟随 Ubuntu 18.04 自定义提示，你会知道如何安装 GNOME Tweaks 工具。在这个工具中，确保你设置“Show Icons”选项为启用。


![Allow icons on desktop in GNOME](/data/attachment/album/201905/18/222606rn3ud71iykdu3nun.jpg)


一旦你确保已经设置，是时候在桌面添加应用快捷方式了。


#### 第一步：定位应用的 .desktop 文件


到 “Files -> Other Location -> Computer”。


![Go to Other Locations -> Computer](/data/attachment/album/201905/18/222608ojiixetwapepwpvv.png)


从这里，到目录 “usr -> share -> applications”。你会在这里看到几个你已经安装的 [Ubuntu 应用](https://itsfoss.com/best-ubuntu-apps/)。即使你没有看到图标，你应该看到被命名为“应用名.desktop”形式的文件。


![Application Shortcuts](/data/attachment/album/201905/18/222611gcm3px4k3n3kcp40.png)


#### 第二步：拷贝 .desktop 文件到桌面


现在你要做的只是查找应用图标（或者它的 desktop 文件）。当你找到后，拖文件到桌面或者拷贝文件（使用 `Ctrl+C` 快捷方式）并在桌面粘贴（使用 `Ctrl+V` 快捷方式）。


![Add .desktop file to the desktop](/data/attachment/album/201905/18/222614clnp65n831nznw8t.jpg)


#### 第三步：运行 desktop 文件


当你这么做，你应该在桌面上看到一个图标的文本文件而不是应用 logo。别担心，一会就不一样了。


你要做的就是双击桌面的那个文件。它将警告你它是一个“未信任的应用启动器’，点击“信任并启动”。


![Launch Desktop Shortcut](/data/attachment/album/201905/18/222617luc99ucn9k72nhgf.jpg)


这个应用像往常一样启动，好事是你会察觉到 .desktop 文件现在已经变成应用图标了。我相信你喜欢应用图标的方式，不是吗？


![Application shortcut on the desktop](/data/attachment/album/201905/18/222621ceu0wwzxgwletlcj.jpg)


#### Ubuntu 19.04 或者 GNOME 3.32 用户的疑难杂症


如果你使用 Ubuntu 19.04 或者 GNOME 3.32，你的 .desktop 文件可能根本不会启动。你应该右击 .desktop 文件并选择 “允许启动”。


在这之后，你应该能够启动应用并且桌面上的应用快捷方式能够正常显示了。


### 总结


如果你不喜欢桌面的某个应用启动器，选择删除就是了。它会删除应用快捷方式，但是应用仍安全的保留在你的系统中。


我希望你发现这篇快速指南有帮助并喜欢在 Ubuntu 桌面上的应用快捷方式。


如果你有问题或建议，请在下方评论让我知道。




---


via: <https://itsfoss.com/ubuntu-desktop-shortcut/>


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

A classic desktop operating system always has icons on the ‘desktop screen’. These desktop icons could include the file manager, the trash bin and the shortcut to various applications.

While installing applications on Windows, some programs ask if you want to create a shortcut on the desktop. That’s not the case on Linux, though.

But if you are a fan of this feature, let me show you how you can add desktop shortcuts to your favorite applications on [Ubuntu](https://www.ubuntu.com/?ref=itsfoss.com) and other Linux distributions.

## Adding Desktop Shortcuts in Ubuntu

![a screenshot of desktop shortcuts on ubuntu](https://itsfoss.com/content/images/2023/10/UDS_7.png)

Personally, I prefer the Ubuntu launcher for application shortcuts. If I use a program frequently, I add it to the launcher. But I know not everyone has the same preference, and a few people prefer shortcuts on the desktop.

Anyway, let’s see the simplest way of creating an application shortcut on the Ubuntu desktop.

### Step 1: Locate the .desktop files of applications

Go to **Files → Other Locations → Computer**.

![a screenshot of the other locations menu in ubuntu](https://itsfoss.com/content/images/2023/10/UDS_1.png)

From here, go to the directory **usr → share → applications**.

You’ll see icons of several [Ubuntu applications](https://itsfoss.com/best-ubuntu-apps/) you have installed here. Even if you don’t see the icons, you should see the .desktop files that are named as **application.desktop**.

![a screenshot of the applications folder under the usr directory on ubuntu](https://itsfoss.com/content/images/2023/10/UDS_2.png)

### Step 2: Copy the .desktop file to the desktop

Now, all you have to do here is to look for the application icon (or its .desktop file). When you find it, either drag-drop the file to the desktop or copy the file (Ctrl+C shortcut) and paste it on the desktop (Ctrl+V).

![a screenshot showing the method for copying a .desktop file to the desktop screen on ubuntu](https://itsfoss.com/content/images/2023/10/UDS_3.png)

### Step 3: Run the desktop file

When you do that, you should see an image file style icon on the desktop instead of the logo of the application. Don’t worry, things will be different soon.

You just have to right-click on the .desktop file and click on “**Properties**”. In here, allow the file execution permission.

![a screenshot showing how to allow executing file as program on ubuntu](https://itsfoss.com/content/images/2023/10/UDS_4.png)

Now, if you right-click on the file, you will find an “**Allow Launching**” option. Select it, and you will see that the file has turned into an application shortcut.

Next, you can double-click it or right-click on it to hit open to launch the application.

![a screenshot showing how to allow launching of apps from a desktop shortcut on ubuntu](https://itsfoss.com/content/images/2023/10/UDS_5-1.png)

I believe you like the application shortcuts this way, don’t you?

### Troubleshoot for Flatpak apps

For users of Flatpak apps, the method is slightly different. The .desktop files are located elsewhere. You can follow this path instead:

First, Go to **Files → Other Locations → Computer**.

Next, navigate your way to the app directory of Flatpak:**var → lib → flatpak → app**.

Thereafter, go into the folder for the app of your choice.

Finally, head into **current → active → export → share → applications**.

![a screenshot of a .desktop file for the flatpak version of firefox on ubuntu](https://itsfoss.com/content/images/2023/10/UDS_6.png)

You will find the .desktop file for the app in there. Subsequently, just follow the instructions from '**Step 2**' onwards as shown above.

## Conclusion

Even if you don’t like a certain app shortcut on the desktop, you can just select it and delete it. It will delete the shortcut, but the application will remain safely in your system.

I hope you found this quick tip helpful, and can now enjoy the application shortcuts on Ubuntu's desktop screen.

*💬 If you have questions or suggestions, please let me know in the comments below.*