Chapter 5

Use the Desktop

The easiest way to use your Pi is to open the built-in desktop. The Pi’s desktop looks and works like other computer desktops. It’s not exactly the same as a Windows or Mac desktop, but it’s close enough. You don’t have to learn a whole new way of using a computer.

image

Get Started with the Desktop

To make the desktop appear, type startx and press Enter when the dollar sign appears after you power up the Pi and log in with Pi as the username and “raspberry” as the password.

The Pi loads its desktop app — this takes a while — and eventually you see the screen shown in Figure 5-1. You can now click around with your mouse, open, drag, resize and close windows, launch apps, and do all the things you usually do on a desktop.

technicalstuff On the Pi, the desktop is an application called LXDE, which is short for Lightweight X11 Desktop Environment. In theory, you can use a different desktop app. Two popular options are called Gnome and KDE. They have more features than LXDE and look different. Getting them to work on a Pi can be hard, so this book sticks with LXDE. It’s already installed on the Pi, and it works just fine.

Use the Older Desktop

If you have an older version of the Pi software, you may see the screen shown in Figure 5-2. This is the old version of the desktop. It has all the same stuff, but some of it is in different places.

The old version is easier to understand. Icons for important apps like Scratch and Python are right in front of you. To launch the apps, double-click them.

In the new version, you can see the same things by clicking the menu at the top left. Scratch and Python are inside the Programming menu. To launch them, single-click them.

Don’t sweat the differences. Both desktops have the same options. This book uses a mix of desktops so that you can get used to both. The desktop may change again in the future, so it’s good to understand that sometimes things move around!

warning You might like the old desktop better. Unfortunately, you can’t switch to the old desktop if your Pi software loads the new desktop. If you want the old desktop, you have to find and install an old version of NOOBS. And if you do that, you’ll miss out on some cool updates.

Tour the Desktop

What does everything do? The desktop is split into two main areas.

  • Taskbar
  • Desktop area

Find the taskbar and desktop area

The taskbar is the area with the clock, the icons, the menu, and the graph thing with a percentage, which I explain in the upcoming section “Use the Activity Monitor.”

On the old desktop, the taskbar is at the bottom of the screen. On the new desktop, it’s at the top.

The old desktop has a few icons floating on it. On the new desktop, the background area has the Trashcan icon, and nothing else.

Work with windows

When you open a window, it floats over the desktop area. You can drag the window around, resize it, and do all the usual things to it.

To drag a window, click the colored area at the top with the name and/or description. It’s called the title bar because it looks like a bar and it has a title.

You can click any window edge and drag it. You also can click a window bigger or smaller by clicking the bottom right corner.

The top right of the window has three small buttons. In order, they hide the window, make the window fill the screen, and close the window.

warning Sometimes closing a window quits an app. If an app has more than one window — some do, others don’t — you need to use File⇒Quit to quit.

When you open a window, the desktop creates a tab in the taskbar. When you hide a window, the tab stays in the taskbar so that you can click it to show the window again.

Figure 5-3 shows a desktop with a handful of windows and tabs. All the windows are hidden, except one.

technicalstuff It’s called a desktop because windows are supposed to work a bit like sheets of paper on a real wooden desk. Of course, you can’t drag the corner of paper to make it bigger or smaller. And you can’t run apps on paper. And you can’t minimize paper to hide it. But apart from that, it’s a bit like pushing paper on a real desk.

Use the Taskbar

Click on the Taskbar menu, and you can see submenus with all kinds of apps and features. If you’ve used the desktop on a Windows PC or a Mac, you can probably guess what some of them do.

The taskbar also has quick launch icons. They get special treatment. Icons in the desktop area are often hidden behind open windows, which makes them hard to use, but you can always see the quick launch icons.

Here’s the list of quick launch icons for the new desktop:

  • Epiphany Web Browser
  • File Manager
  • LXTerminal
  • Mathematica
  • Wolfram Language

This book doesn’t have much to say about the last two items. They’re for older Pi users who need help with high school and college math.

But you need to know how to use the first three items in the list to get the most value from the Pi’s desktop.

Use the Quick Launch Icons

To use a Quick Launch app, click its icon. Your Pi launches the app, and its window appears on the desktop.

Desktop windows all work the same way.

Get started with Epiphany

Epiphany, shown in Figure 5-4, is the Pi’s web browser. It works just like any other web browser. You can type a URL into the URL box and open multiple tabs. Figure 5-4 shows Epiphany with the main Google page loaded.

But it’s not quite like other browsers, and there are a couple of things you need to know about it.

  • It has a strange name.
  • It’s reallllly slow.

The first thing isn’t a big deal. The weird name means sudden realization. It’s really just an excuse to give the Pi a web browser with a name that has pi in it.

The second thing is more important. The Pi is not a fast computer, and Epiphany is not a fast web browser. It can take a minute or two for some pages to load. Epiphany also has problems loading some pages. If you see an error message when you try to load a page, it’s not usually your fault.

tip It’s fine to use Epiphany to test a web server on your Pi. So if you need to look things up online, it’s best to use a browser on another computer. Otherwise, you’ll be waiting for it to finish loading pages — a lot!

In Epiphany, you can search the web for a word or phrase by typing it into the URL box and pressing Enter. Epiphany uses a search engine called Duck Go. It gives similar results to Google, but includes bigger ads. If you want to use Google instead, you can open the main Google page (www.google.com) and search from there.

Explore files with File Manager

Files are the information you store on your computers. To keep files organized, they’re often kept in folders. Folders can contain more folders. Or more files. Or both. (But they can’t contain squirrels. Which is a good thing.)

To help you find your way around, the Pi includes a file manager app called File Manager.

You can find the icon to the right of the web browser icon in the taskbar. It looks like a battered filing cabinet. To launch File Manager, click the icon. Figure 5-5 shows the file list that appears.

Understand files in File Manager

File Manager shows a list of folders at the left of the window. To see the files inside a folder, click it. The files appear in the right of the window.

To see the folders inside a folder, click the tiny triangle next to the folder name. When a folder is open — showing the folders inside it — the triangle points down. When a folder is closed, the triangle points to the right, at the folder name.

The complete list of folders is called the directory tree because it’s a bit like an upside-down tree. The tree builds down from a root, which is the super-important everything-starts-here folder.

This folder is so important it has a super-important name. It’s called / — a single backslash.

tip Maybe / is easier to type than thisisthesuperimportantrootfolder.

If you refer to Figure 5-5, you can see that the superimportantrootfolder includes a lot of other folders. They hold the files and folders that make your Pi work.

You can also see a folder called pi at the top of the list. This is your home folder. Every user on a Pi has a home folder. Because you spend a lot of time at home, File Manager includes it in the directory tree so that you can get to it quickly without having to find it in the main tree.

warning Does this mean it’s in two places? No! There’s only one home folder. But you can get to it in two ways in File Manager. One way is a quick-click to save you having to take the long way. The other way is the long way. It takes a lot of scrolling and clicking, so it’s very handy to have a shortcut.

Move around in File Manager

The directory tree gives every single file in your Pi its own address — which is just the list of folders you need to click through to get to the file.

Addresses look like this:

/home/pi/mystuff/and_so_on…

technicalstuff File addresses are also called paths. Getting to an address is a bit like walking down a path with lots of side alleys and turnings.

To get to a file at that address:

  1. Click the /home folder.
  2. Click the /pi folder inside home.
  3. Keep clicking folders to look inside them until you get to the folder you want.

As you open more and more folders, File Manager always shows you where you are. It’s hard to get lost.

Here’s a real example, which takes you to the pre-installed apps in your Pi, including the web browsers mentioned in the sidebar “Using other web browsers”:

/usr/share/raspi-ui-overrides/applications

See whether you can click your way through the address to find the files. You’ll need to scroll down through the tree to see all the folders in /usr/share because there’s a lot of stuff in there.

Figure 5-6 shows all the apps in File Manager. The folder includes the apps in the desktop menus and some others. You can double-click any of them to launch them.

tip While you’re in this folder, you may want to try setting up WiFi with the WiFiConfiguration app. Double-click it to launch it.

warning The Pi isn’t great at WiFi. For example, it doesn’t scan for networks automatically. The best way to find full instructions is to search online for WiFi Pi setup.

Meet god-mode

You’ll soon discover that the Pi doesn’t let you look inside certain files and folders. In fact, you’re locked out of most of the file system!

There is a reason for this. The Pi’s Linux operating system locks you out deliberately so that you can’t break something byaccident. As an ordinary user, you’re not allowed to touch the Pi’s moving parts or stick your finger into any power sockets.

Frustrating, huh? It would be even more frustrating if you were locked out forever. But there is a back door. If you know the magic words, you can promote yourself to a special god-user called root and gain superpowers that let you do whatever you want.

Chapter 10 has more about becoming the god-user. You don’t need to worry about it for now. You only need god-mode if you’re installing new software or changing something important in your Pi.

technicalstuff Mac and Windows computers include god-mode, too. They just hide it better. When your Mac or PC asks for your password before it does something — that’s a god-mode check.

Use the Activity Monitor

Your Pi often needs to think for a while when you ask it to do something. Windows computers show you an hourglass while they’re thinking. Mac computers show a spinning colored wheel, which is sometimes called the pizza wheel even though no one has ever seen a pizza with all those colors.

The Pi has the Activity Monitor. It’s the box with a scrolling graph and a percentage at the right of the taskbar.

The Activity Monitor is more important than it looks because it shows you how hard your Pi is working. At 0 percent your Pi is doing nothing. At 100 percent, your Pi is working very hard. If you ask it to do something when it’s working very hard, it’s going to take longer than usual to do it.

tip There’s a clock to the right of the Activity Monitor. When your Pi is connected to the Internet, the clock sets itself. If you click the clock, you can see a calendar.

Use the Desktop Menu

The Desktop menu includes a selection of useful apps. To open the menu, click the Menu button at the top left of the taskbar.

On the old desktop, click the spiky shape (it’s the logo for the desktop, but you’d never guess) at the bottom left.

You can drag the mouse over the menu items to see more items in each group. Click an app to launch it.

Figure 5-7 shows the Accessories.

Edit Files

The desktop includes an editor. You can make a small change to the Pi to make it easier to use on a network.

To edit a file using the Leaf text editor, start by clicking the taskbar Menu button and drag the mouse over the Accessories item. Move it to the right and down a bit and click the big green leaf icon labeled Text Editor.

The text editor loads with a blank window. You can type text into the window with your keyboard, edit the text with your keyboard and mouse, and choose File ⇒ Save As to save the file.

You can also load an existing file by choosing File⇒Open. The editor displays a file selector.

The selector works a bit like a smaller version of File Manager. It has a list of folders and shortcuts at the left and a window showing the files in each location at the right.

But it doesn’t show the super-important folder named /. Instead, it has a shortcut labeled File System, — which takes you to / because / is the file system.

Double-click File System and work your way through the folders to

/etc/network

Double-click the file named interfaces, as shown in Figure 5-8. You can also click the file once and then click the Open button.

tip See those buttons above the folder and file area? Every time you double-click a folder to open it, the file selector adds it as a button. The buttons are a super-speedy shortcut feature. Click a button to go straight to that folder. You’ll also see a Recently Opened list in the file area. The file selector remembers the files you worked on recently, so you don’t have to find them again — you can double-click the name of the file instead.

The editor loads the file. You’ll see some cryptic computer gobbledeegook, as shown in Figure 5-9. The gobbledeegook is a collection of magic words. They tell your Pi how to connect to the local network and the Internet.

If you know the right magic words, you can edit the file to make your Pi work differently.

Linux is more hands-on than Windows or OS X, and a lot of important settings are hidden in text files.

How do you know which file to edit, and how to change it? You don’t. Linux is complicated. You will never, ever be able to guess how to find most of its settings or how to change them after you find them.

You have to look them up online. Whenever you want to change a setting in your Pi, search online for instructions.

This isn’t cheating! Professional developers do it all the time when they don’t know how to do something. It’s not as neat and easy as changing a few settings in a preferences panel. But once you figure out how to do it, you can customize your Pi and make it do things you can’t do with other computers.

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

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