Raspberry Pi 简明教程

Raspberry Pi - Working with Linux

本章阐明了 Raspberry Pi 使用 Linux 的功能。

This chapter enlightens about the functioning of Raspberry Pi with Linux.

PIXEL Desktop Environment

PIXEL(Pi 改善的 Xwindows 环境,轻量级)是一个可视桌面环境,它是推荐的 Raspbian Linux 发行版的一部分。这是开始使用 Raspberry Pi 的最快方式,并且在默认情况下,它在我们的 Raspberry Pi 计算机完成启动时出现。

PIXEL (Pi Improved Xwindows Environment, Lightweight) is a visual desktop environment which is a part of the recommended Raspbian Linux distribution. It is the quickest way to get started with Raspberry Pi and by default, it appears when our Raspberry Pi computer finishes starting up.

PIXEL 的一些特征如下:

Some of the characteristics of PIXEL are as follows −

  1. It is based on LXDE (Lightweight X11 Desktop Environment) open-source desktop.

  2. Raspberry Pi foundation has redesigned LXDE and converted it into a PIXEL desktop environment.

  3. The PIXEL desktop environment works in a similar way to Mac OS and Windows OS.

  4. We can manage and find files by using mouse and icons.

  5. Using this desktop environment, it’s really intuitive to navigate.

Navigate Desktop Environment

下图是 PIXEL 桌面环境。你可以看到一个任务栏(屏幕顶部的条带),在我们将要使用的所有程序中通常都是可见的。

The image below is of the PIXEL desktop environment. You can see a taskbar (a strip along the top of the screen), which is usually visible in every program we will be using.

navigate desktop

The Application Menu

对于我们要在 PIXEL 桌面或任何其他桌面环境下运行的大多数程序,我们需要使用应用程序菜单。你可以通过点击桌面屏幕左上角的 Raspberry Pi 图标来使用它。

For most of the programs, which we would like to run under PIXEL desktop or any other desktop environment, we need to use the application menu. You can get it by clicking the Raspberry Pi icon at the top left side of the desktop screen.

你将看到如下图像 -

You will see the image as follows −

application menu

Submenu Programs

在光标移动到程序类别之后,你将在右侧看到子菜单程序。它将显示该特定类别中的程序。

You will get the submenu program on the right, after moving the cursor over the categories of the programs. It will show the programs in that particular category.

你需要点击该类别以从中开始。如果你想将该类别图标添加到桌面,只需右键点击菜单中的该程序即可。

You need to click on that category to start with that. If you want to add that category icon to the desktop, just right-click that program on the menu.

以下是子菜单程序中的丰富程序 -

Following are the wealth of programs under submenu program −

Claws Mail

它位于应用程序的互联网部分,你可以借助该部分在 Raspberry Pi 计算机上发送或接收消息。

It is in the internet part of the Application with the help of which you can send or receive messages on your Raspberry Pi computer.

Debian Reference

正如我们之前讨论的,Linux 的 Raspbian 版本是 Debian 发行版的 Pi 专用版本。此图标将指导我们如何在 Raspberry Pi 计算机上使用 Linux。

As we have discussed earlier, the Raspbian version of Linux is the Pi-specific version of the Debian distribution. This icon will guide us how to use Linux on your Raspberry Pi computer.

这是一份参考文档,存储在你的 SD 卡上,要找到它,你需要在应用程序菜单中找到“帮助”部分。

This is a reference document, which is stored on your SD card and to find this, you need to go through the help section of the Application menu.

要开始,首先你需要点击图标,然后点击屏幕顶部的多文件链接(这是一个 HTML 链接)。

To get started with this, first, you need to click the icon and then, click the multi-files link (it is an HTML link) which is at the top of the screen.

LibreOffice

这是最流行的生产力应用程序套件。它主要包括文字处理、电子表格和演示文稿。你可以从应用程序菜单的办公室部分中获得它。

This is the most popular suite of productivity applications. It mainly includes word processing, spreadsheets, and presentations. You can get it from the office section of the Application menu.

Mathematica

在应用程序菜单的编程部分中,Mathematica 采用 Wolfram 编程语言。它用于科学和技术计算。

Mathematica, under the programming section of the Application menu, is based on the Wolfram programming language. It is used for scientific and technical computing.

Minecraft Pi

我们知道一款名为 Minecraft 的世界构建游戏。同样,Minecraft Pi 是该游戏的 Raspberry 版本。你可以在应用程序程序的游戏部分中找到它,你还可以使用 Python 编程语言对其进行编程。

We know about the world-building game called Minecraft. Similarly, Minecraft Pi is the Raspberry version of that. You can find it under the Game section of the Application program, and you can also program it by using the Python programming language.

Python 2 and Python 3

Raspberry Pi 为我们提供了 Python 编程语言,可以在应用程序菜单中的编程部分中找到。我们还可以使用 Thonny IDE(集成开发环境),它为 Pi 用户提供了一种创建 Python 程序的替代方式。

Raspberry Pi provides us the Python programming language, which can be found under Programming in the Application menu. We can also use the Thonny IDE (integrated development environment) which provides the Pi users, an alternative way of creating Python programs.

Python games

Raspberry Pi 拥有 Reversi、Four in a Row、滑块拼图游戏以及蛇形游戏等游戏。所有这些都是使用 Python 编程语言构建的,可以在应用程序菜单的游戏部分中找到。

Raspberry Pi has games such as Reversi, Four in a Row, a sliding puzzle game as well as a snake game. These all are built in Python programming language and can be found in the Game section of the Application menu.

Scratch

树莓派基金会提供了一种名为Scratch的简单编程语言,适用于所有年龄段的人群。您可以使用它创建游戏和动画。它还可以用于管理电子项目。您可以在Application菜单的编程部分中找到它。

Raspberry Pi foundation provides us a simple programming language called Scratch, which is approachable for the peoples of all ages. You can use it to create games and animations. It can also be used to manage electronic projects. You can find it under the Programming section of the Application menu.

Sense HAT emulator

顾名思义,它有一些内置传感器,可用于创建实验和其他项目。作为Raspberry Pi用户的一项附加功能,它可以位于应用程序菜单的编程部分下。

As the name implies, it has some built-in sensors that can be used for creating experiments and other projects. It is an add-on for the Raspberry Pi users, which can be found under the Programming section of the Application menu.

Shutdown

应用程序菜单中的顶级选项“关机”用于在断电之前关闭Raspberry Pi。借助此功能,我们还将获得注销以及重新启动Pi计算机的选项。

Shutdown, a top-level option in the Application menu, can be used for switching off your Raspberry Pi, before you remove the power. With this, we will also get the options to log out as well as restart your Pi computer.

Sonic Pi

这是由Raspberry Pi基金会提供的另一种编程语言,主要用于创作音乐。您还可以在Application菜单的编程部分中找到它。

It is another programming language provided by Raspberry Pi foundation which is mainly used for creating music. You can also find it under the Programming section of the Application menu.

Terminal

终端是一个窗口,它让我们在不离开PIXEL桌面环境的情况下,从命令行发布指令。您可以通过两种方式访问终端窗口。一种是通过程序菜单的附件部分获取它,另一种是使用任务栏上的按钮。

Terminal is a window that let us issue the instructions from a command line without leaving your PIXEL desktop environment. There are two ways through which you can reach the terminal window. One is to get it in the Accessories part of the Programs menu and other is to use the button on the taskbar.

Wolfram

Wolfram是由Raspberry Pi基金会提供的编程语言。它的目标是纳入知识,以便程序员能够快速获得结果。您可以在 www.wolfram.com/language 上获取更多信息。它位于应用程序菜单的编程部分下。

Wolfram is a programming language provided by Raspberry Pi foundation. It aims to incorporate knowledge, so that the programmers can get results quickly. You can get more information about this at www.wolfram.com/language. It is under the Programming section of the Application menu.

Running programs

即使安装完毕,某些程序也不会出现在应用程序菜单上。您可以使用 Run option 运行这些程序。

Even after installing, some of the programs won’t appear on the Application menu. You can use the Run option to run those programs.

请按以下步骤操作 -

Follow the below given steps −

Step 1 − 首先,我们需要打开应用程序菜单。为此,单击桌面左上角的图标。

Step 1 − First, we need to open the Application menu. For this, click the icon at top left of the desktop.

Step 2 − 现在,我们需要从此菜单中选择“运行”选项。

Step 2 − Now, we need to select the Run option from this menu.

Step 3 − 运行选项将提供一个对话框。您可以键入您要打开的程序的名称,然后按Enter。

Step 3 − Run option will give you a dialog box. You can type the name of the program, which you want to open, and then press Enter.

Close and Rearrange Programs

PIXEL桌面环境中关闭和重新排列程序的控件与MS Windows中的控件类似。这些控件使我们能够关闭以及调整程序的大小(最小化和最大化)。

The controls for closing and rearranging the programs on the PIXEL desktop environment is like the ones in MS Windows. These controls enable us to close as well as resize (minimize and maximize) the programs.

您可以在右上角找到这些控件。它们在下面进行了说明:

You can find these controls in the top right. They are explained below −

  1. X button − It is used for closing the programs/applications.

  2. Maximize button − As the name implies, this button will enlarge a particular application. Once used, the application will fill the screen.

  3. Minimize button − As the name implies, this button will reduce a particular application. It will hide the program from view but does not stop it from executing/running. We can return to the program by clicking the name of the program on the taskbar.