Creating desktop shortcuts in versions of Ubuntu prior to 11.04 was as easy as right-clicking on the desktop and creating a launcher. However, now, you must install extra packages and then run a special command to create a shortcut.
在11.04之前的版本的Ubuntu中创建桌面快捷方式就像在桌面上右键单击并创建启动器一样容易。 但是,现在,您必须安装额外的软件包,然后运行特殊命令来创建快捷方式。
We will show you how to install the required packages and how to create a shortcut.
我们将向您展示如何安装所需的软件包以及如何创建快捷方式。
To begin installing the required packages, press Ctrl + Alt + T to open a Terminal window. Type the following command at the prompt and press Enter.
要开始安装所需的软件包,请按Ctrl + Alt + T打开“终端”窗口。 在提示符下键入以下命令,然后按Enter。
sudo apt-get install --no-install-recommends gnome-panel
sudo apt-get install --no-install-recommends gnome-panel
NOTE: Make sure to enter two dashes before “no” in the above command.
注意:确保在上述命令中的“否”之前输入两个破折号。
The “–no-install-recommends” option makes sure that only the required packages and no recommended packages get installed. This saves space on your hard drive.
“ –no-install-recommends”选项可确保仅安装必需的软件包,而不会安装推荐的软件包。 这样可以节省硬盘驱动器上的空间。
Enter your password when prompted.
出现提示时输入密码。
Messages telling you what packages will be installed and how much disk space will be used display. When asked if you want to continue, type a “Y” (without the quotes) and press Enter.
显示告诉您将要安装哪些软件包以及将使用多少磁盘空间的消息。 当询问您是否要继续时,键入“ Y”(不带引号),然后按Enter。
When the installation is done, you can create a new shortcut using the command line. Type the following command at the prompt and press Enter.
安装完成后,可以使用命令行创建新的快捷方式。 在提示符下键入以下命令,然后按Enter。
gnome-desktop-item-edit --create-new ~/Desktop
NOTE: Make sure there are two dashes before create, not one.
注意:在创建之前,请确保有两个破折号,而不是一个。
The Create Launcher dialog box displays. When creating shortcuts to programs, make sure Application is selected from the Type drop-down list. It should be the default selection.
将显示“创建启动器”对话框。 创建程序的快捷方式时,请确保从“类型”下拉列表中选择了“应用程序”。 它应该是默认选择。
Enter a name for the shortcut in the Name edit box. Enter the command with the full path to start the program in the Command edit box. You can also use the Browse button to select the command. Most programs program executables are installed into the /usr/bin directory. If desired, you may enter a description for the shortcut in the Comment edit box. However, a Comment is not required. Click OK to create the shortcut.
在“名称”编辑框中输入快捷方式的名称。 在命令编辑框中输入带有完整路径的命令以启动程序。 您也可以使用“浏览”按钮选择命令。 大多数程序的程序可执行文件都安装在/ usr / bin目录中。 如果需要,可以在“注释”编辑框中输入快捷方式的描述。 但是,不需要注释。 单击“确定”创建快捷方式。
Because you opened the Create Launcher dialog box from a command prompt, you are returned to the prompt when the dialog box closes. To close the Terminal window, type “exit” (without the quotes) at the prompt and press Enter.
因为您是从命令提示符处打开“创建启动器”对话框的,所以当对话框关闭时,您将返回到提示符。 要关闭“终端”窗口,请在提示符下键入“ exit”(不带引号),然后按Enter。
The shortcut displays on the desktop allowing you to double-click on it to open the program, just like you would use shortcuts on a Windows desktop to open programs.
快捷方式显示在桌面上,允许您双击它以打开程序,就像在Windows桌面上使用快捷方式打开程序一样。
You can also create shortcuts by pressing Alt + F2, entering the command listed above in the edit box, and pressing Enter. The Create Launcher dialog box displays as shown above and you can create another shortcut.
您还可以通过按Alt + F2,在编辑框中输入上面列出的命令,然后按Enter来创建快捷方式。 显示“创建启动器”对话框,如上所示,您可以创建另一个快捷方式。
You can also add shortcuts on your desktop to the Unity launcher by dragging and dropping them onto the launcher.
您还可以通过将桌面上的快捷方式拖放到启动器上,将其添加到Unity启动器中。
翻译自: https://www.howtogeek.com/106470/create-desktop-shortcuts-in-ubuntu-11.04-and-11.10/