© Brian Schell 2019
B. SchellComputing with the Raspberry Pihttps://doi.org/10.1007/978-1-4842-5293-2_3

3. The Raspberry Pi Desktop Tools

Brian Schell1 
(1)
Flint, MA, USA
 

Your Raspberry Pi-based computer is now all assembled and working. Now what? It’s time to learn how to use the basic user interface. If you’ve ever used Windows or a Mac, you already know how the mouse and keyboard work, but the menus and controls in Raspbian are a little different. We’ll also spend some time explaining several different ways that software and apps can be installed, and this is significantly different from other operating systems, so you’ll absolutely need take a few notes here.

Using the Interface

Now that we have all the hardware set up, it’s time to look at software. Once you’ve gone through all the system setup screens, you’ll be presented with a blank desktop environment, as shown in Figure 3-1.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig1_HTML.jpg
Figure 3-1

The Raspbian desktop

There are several important sections to note. At the top of the screen is the menu bar, and there are groups of icons on the left and the right. The three icons next to the raspberry (see Figure 3-2) are for the Chromium web browser (the globe icon), the File Manager (the file folders icon), and the terminal (the command prompt icon). If you don’t remember what these are, you can just hover your mouse over them, and little “tool tips” will appear.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig2_HTML.jpg
Figure 3-2

The upper-left icon area

Beneath the raspberry icon is an icon for the trash can, and, if you plugged in an external hard drive, one or more hard drive icons should appear here.

At the top right of the screen, as in Figure 3-3, are the hardware controller buttons.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig3_HTML.jpg
Figure 3-3

The upper-right icon area

These buttons allow you to control Bluetooth (the Bluetooth logo), Wi-Fi and Ethernet (the up/down arrows), and the audio volume (the speaker icon).

Next to that is a simple meter that shows how much CPU capacity is being used (in percent), followed by a clock/calendar, and lastly you will find an “eject button icon” that you can use to eject media such as flash drives and other removable media.

The list of installed apps can be accessed by clicking the raspberry icon at the top left. The menu options that have an arrow next to them have sub-menus that you can explore. For example, click the raspberry icon, then move your mouse down, and hover over the option for “Preferences”; and you’ll get a list of apps that involve customizing the interface, just as in Figure 3-4.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig4_HTML.jpg
Figure 3-4

The Preferences menu options

The last item on the list, “Theme and Appearance Settings,” is worth taking a closer look at. This screen allows for some very fine-tuned interface options. You can change the font of the desktop, the style of the icons, and even the way all the dialogs look. For example, if you choose the “Adwaita-dark” theme under the “Widgets” tab, you effectively put the desktop into dark mode, as in Figure 3-5.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig5_HTML.jpg
Figure 3-5

Adwaita-dark theme for Widgets

Under Preferences ➤ Desktop Preferences, you can change the colors of the menu bar; and under the “Desktop” tab, you can change the background picture, or if you don’t want a background photo, you can choose a plain, single-color background.

Overall, you’ll find that working with the Raspbian desktop is a lot like working with Windows or Mac in the way things work. Right-clicking the mouse or two-finger trackpad clicking will often bring up some kind of contextual menu, items can be dragged around the desktop, and cut and paste options work just about the same as they do on other systems.

Shutting Down the System

With most modern operating systems, you have to go through a “shutdown process” before you turn off your computer, and the Pi is no different. When you are ready to turn off (or reboot) your Raspberry Pi, you can do this from either the desktop or the command line.

From within the GUI, click the raspberry icon, and the last thing on the dropdown menu is “Shutdown.” You’ll see a dialog box with three choices: Shut Down, Reboot, and Cancel.

From the command line, you can simply type
sudo shutdown
or
sudo reboot

The File Manager

One system app that needs some discussion is the File Manager. This app is launched by clicking the file folder icon on the menu bar. This will bring up an app that looks very much like Windows’ File Explorer or the Mac’s Finder. See Figure 3-6.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig6_HTML.jpg
Figure 3-6

The File Manager app

The system file structure is displayed in the left pane, while the various folders and files show up in the right pane. Across the top is the menu bar. In the file structure pane, you can expand or collapse folders either by clicking the plus or minus signs next to the folder icons or by double-clicking them.

Keep in mind that if you are coming from a Windows background, the Linux file structure is very different from what you may be used to. You have full access (called permissions in Linux) to delete, copy, and manipulate most files within your own user account folder (called “brian” in the screenshot in Figure 3-6); but you cannot alter things outside that directory unless you use the sudo command . The only way to run a sudo command is to type it from the command line. This may seem like an annoyance, but it’s a security feature that is time-tested in decades of Unix use.

Installing Apps

There are a lot of great apps already installed with Raspbian; there’s an office app, a web browser, a media player, and a lot of other useful things. If you haven’t already, now would be a great time to browse through the menus and see what all is in there. Even with all that, the Raspbian folks obviously couldn’t include everything out there, since Raspbian is essentially just a version of Linux, and there are a vast number of apps available for that. Once in a while, you’ll hear about some great thing that didn’t come included with Raspbian that you want to try.

There are three primary ways to install software on Raspbian: compiling it from source code, downloading it from the Ubuntu repositories, or installing it from the command line.

Building Apps from Source Code

This is the hardest way to do it, and unless you know what you’re doing, I wouldn’t go this route unless the software you want has very explicit instructions for building the app. Most Raspbian apps are open source software, meaning that you can actually download and read the programming code that went into making the software.

Some apps that are still in development only offer this source code, and the code has to be compiled in order to run. There are a lot of variables involved with available libraries, tools, and languages; so unless you just absolutely have to build the app, look for an easier way.

Installing Apps from the Add/Remove Software Tool

Knowing how hard it is to build software from source code, the folks who put together Raspbian created an app that would index and list hundreds of apps and tools that are ready to use, just like Raspbian’s version of the app stores from other operating systems. This app can be found under Raspbian ➤ Preferences ➤ Add/Remove Software and can be seen in Figure 3-7.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig7_HTML.jpg
Figure 3-7

Add/Remove Software tool

You can browse the categories in the left pane and then scroll through the lists of apps in the right pane. If you know the specific name of something you want to install, type it in the search box. If you find an app that you want to try, select it and click OK. After a few moments, the app should be downloaded and installed for you. After an app has been installed, it will show up on this list with a checkmark next to it. If you uncheck the box and click “Apply,” it will be uninstalled. Easy!

Even better, this tool allows you to easily look for and install updates and patches to the apps you’ve already installed. Click the options menu on the Add/Remove Software app. The first option is “Check for Updates.” Click it, and you’ll see something like Figure 3-8.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig8_HTML.jpg
Figure 3-8

Available Updates screen

And here it’s very clear that I have two apps that need updating. Click “Install Updates,” and they’ll download and install the updates for you.

There are two problems with this method. First, there’s not much description of what everything is, so unless you have a specific app or tool in mind, you may never find it. Second, this tool doesn’t work remotely. You can run the Add/Remove Software tool in VNC, but the software will not install. This may be a security feature, or it may be a bug, but it will not work.

Installing Apps from the Command Line

The Add/Remove Software tool that we just described is really easy to use, but you may soon find that the selection of apps is still somewhat limited. There’s a lot of good stuff there, and I strongly recommend browsing and exploring those apps, but there are a huge number of very powerful apps that still aren’t included in that list. I have found the command line is the easiest way to install just about anything I ever wanted. There’s nothing complicated at all about this, but the one requirement is that you have to know the name of the package you want in advance. This requires some reading or some Internet research, but once you know what you want, getting it is easy.

First, launch a terminal window. Then, type the following lines:
sudo apt update
sudo apt install packagename

The first line updates all the repositories. These online repositories index all the available apps and tools that are available and the Internet locations that hold the install files for them. They change constantly with new versions and new tools being added all the time, so I always run this update command first, just to make sure the newest versions are found.

In the second line, sudo is once again the command that gives you superuser permissions, which is required to install software. Apt is short for Advanced Packaging Tool , and it is the app that does the installation. Install is what we specifically want the apt program to do, and packagename should be replaced with the name of the package we want to install.

For example, if you’ve been hearing about this neat app called Neofetch , you can just type
sudo apt install neofetch
to install it. If you later decide you don’t want Neofetch anymore, you can delete it in a similar way:
sudo apt remove neofetch
Try it now. Neofetch is not installed on your Pi by default, so let’s install it. Type the preceding commands to update the repositories, and then install the app. When that’s done, type the command neofetch on the command line. You should see something very similar to Figure 3-9.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig9_HTML.jpg
Figure 3-9

We have just installed the Neofetch app

Neofetch is a nice little command-line app that prints out the textual-graphic representation of the Raspbian logo and reports on some technical stuff about our little machine as well. It’s not super useful, but it wasn’t there before we installed it!

Every so often, you should update all your software. On a system like Windows, there are so many updates coming in so often that it quickly becomes a major hassle, but it’s different on Linux. The Linux system will not automatically perform upgrades; you have to do it yourself, but at least you can do it when you’re ready. This can be done with two commands:
sudo apt update
sudo apt upgrade

Again, the first line loads in a fresh list of repositories, and then the second line upgrades everything that has an available update.

Along the same lines is an enhanced version of this process that allows you to upgrade the entire operating system to the newest version of Raspbian Linux:
sudo apt update
sudo apt dist-upgrade

But be aware that you probably already have the latest full distribution of Raspbian—it may only be updated once or twice a year, so most of the time this won’t do anything.

Note that there are also other ways of installing software from the command line. We looked at apt (Advanced Packaging Tool) earlier, but there are also pip (Package Installer for Python) and curl (Copy from URL) that are also used occasionally. Which one you use depends on various factors: pip is used to install Python scripts, and curl is used to download and install directly over the Internet. The vast majority of apps install using apt, but be on the lookout for the occasional app that needs one of the others. Of course, I’ll give the installation command for each app that we look at here.

OK, now we are able to search for, install, delete, and update software any which way we want using apt. Now it’s time to get some work done!

Cleaning Up the Raspbian Menus

Raspbian installs many of the most common apps and tools that the Raspberry Pi Foundation believes people are most likely to use. The vast majority of people who buy a Pi are doing so to do electronics projects and experimenting. This means there are a lot of scientific, electronics, programming, and interfacing apps on the Pi; and we aren’t going to want those at all in our “getting work done” desktop. We could go through and uninstall all of the things we don’t want, but in some cases, these apps include files and libraries that may be used by other apps, and we don’t want to cause problems by deleting the wrong things. So rather than uninstall them, we can simply remove them from the menus. The menu editor can be found under Raspberry ➤ Preferences ➤ Main Menu Editor.

Using this tool is pretty not complicated; just select a menu in the left pane and then “uncheck” apps on the right that you want to remove. If you find that you removed something important, just go back and check the box again—nothing is really deleted, although you have the option of deleting them if you want. You can also remove entire menus, such as “Programming” and “Education” as I have in the screenshot in Figure 3-10. You can also move individual apps up or down the list, add dividers, or move them to different menus if you choose. As you can see in Figure 3-10, it’s a very easy, flexible system that can be configured to your specifications.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig10_HTML.jpg
Figure 3-10

Main Menu Editor—removing the unused items

As a side note, it’s probably a good idea to skim through all the menus and take a look at what’s there. There are a number of apps that are already installed on your system, but their menu entries are already grayed out by default. If you want to try these apps, just turn them on and explore.

As we’ve seen, sudo apt install appname will not only install a new app, but it will most often create a menu item for the app as well. This isn’t something you can always assume, and once in a while, you may install an app and not find it in the menus. In order to create a menu item, open the Main Menu Editor and click “New Item,” and you’ll see a small dialog that looks like Figure 3-11.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig11_HTML.jpg
Figure 3-11

Adding a new menu item

This allows us to create a menu item for literally anything. Type in some text for the Name field and, optionally, the Comment field. Both of these can say anything you like. In the Command field, you have two choices: you can enter in the exact same text you would use to start an app on the command line, or you can click the button and browse to where the app is located in the file system. There’s also a checkbox that lets you run the command in a terminal window. If you are running some kind of GUI app, then you don’t need the terminal, but if you want to run a command-line app, then launching it in the terminal allows it to be interactive. In addition, if you have an icon image that you would like to assign to this menu item, you can click the generic icon picture and choose a new one.

Let’s take a common command-line action and make a menu item out of it. For our example, we know that sudo apt update is the command that updates your software repositories. It’s common to do this before installing anything, just so you can be sure you are getting the newest version of the software. Still, you don’t have to actually type that every time; you can make it a menu item.

To do this, you’d type

Update Repositories in the Name field

sudo apt update in the Command field

Update things before downloading a new app in the Comment field.

Lastly, you would want to see this command work and be alerted if there was an error, so you would check Launch in Terminal. Click OK, and now go look at the menu. You should see “Update Repositories” in the menu, similar to Figure 3-12.
../images/485525_1_En_3_Chapter/485525_1_En_3_Fig12_HTML.jpg
Figure 3-12

Update Repositories is now a menu item!

Cloud Services

One thing that I’ve found incredibly useful over the years is making heavy use out of some kind of cloud syncing service. Dropbox, Google Drive, OneDrive, iCloud, and a dozen other options are available for Windows and Mac, but what’s out there for our little Pi?

Well, there’s bad news and there’s good news. None of the major cloud storage providers have a native app that works on the Raspberry Pi. At one time, there was a workaround that allowed Dropbox to work, but Dropbox made changes that broke that. Insynchq.com makes a test version of their client that they claim will work, but I’ve never managed to get it to install properly. Keep an eye out for this; they may get it fully working someday.

In the meantime, all the major services will work through their respective web interfaces. It’s not the same as having an integrated native app that will sync folders seamlessly in the background, but at least you can make use of your favorite service to upload and download files manually. As the RPi devices become more powerful, these providers will see the benefit of creating a native interface, so expect changes here.

Conclusion

Now you’ve gotten into the desktop interface, gone through the menus, and maybe customized a few of them; and more importantly, we learned several different methods of installing new apps, and we’ll need all of them. One of the often-debated weaknesses of Linux is the complexity of installing software and apps, and the simple fact that we just looked at multiple ways to do it proves that true.

Still, we know how it’s done now, so in the next chapter, we’ll look at the best apps for the Raspberry Pi desktop.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.180.32